-
Notifications
You must be signed in to change notification settings - Fork 21
Building your own Microkernel image
The process for building a new Microkernel has been greatly simplified with the v3.0.0 release of the Hanlon-Microkernel project. Previously, users had to build a 'bundle file' containing (among other things) the contents and scripts needed to remaster the Tiny Core Linux ISO (these files were taken from their local copy of the Hanlon-Microkernel repository). Once they had constructed that bundle file, they then could transfer it to a machine that had all of the appropriate Linux/UNIX utilities that were necessary to actually carry out the remastering process in order to build the type of Microkernel (or types of Microkernel) ISOs that they were interested in.
Since the change to a Docker-based Hanlon-Microkernel image that was made in more recent release of this project (v3.0.0 and later) this process is really just a two-command sequence, the first to build the Microkernel image in Docker:
$ docker build -t hanlon-mk-image:`git describe --tags --dirty --always | sed -e 's@-@_@' | sed -e 's/^v//'` .
Sending build context to Docker daemon 132.1 MB
Step 0 : FROM gliderlabs/alpine
---> 2cc966a5578a
Step 1 : RUN apk update && apk add bash sed dmidecode ruby ruby-irb open-lldp util-linux open-vm-tools sudo && apk add lshw ipmitool --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted && echo "install: --no-rdoc --no-ri" > /etc/gemrc && gem install facter json_pure daemons && find /usr/lib/ruby/gems/2.2.0/gems/facter-2.4.4 -type f -exec sed -i 's:/proc/:/host-proc/:g' {} + && find /usr/lib/ruby/gems/2.2.0/gems/facter-2.4.4 -type f -exec sed -i 's:/dev/:/host-dev/:g' {} + && find /usr/lib/ruby/gems/2.2.0/gems/facter-2.4.4 -type f -exec sed -i 's:/host-dev/null:/dev/null:g' {} + && find /usr/lib/ruby/gems/2.2.0/gems/facter-2.4.4 -type f -exec sed -i 's:/sys/:/host-sys/:g' {} +
---> Running in ce0e2c660da7
fetch http://alpine.gliderlabs.com/alpine/v3.2/main/x86_64/APKINDEX.tar.gz
v3.2.3-105-ge9ebe94 [http://alpine.gliderlabs.com/alpine/v3.2/main]
OK: 5290 distinct packages available
(1/35) Installing ncurses-terminfo-base (5.9-r3)
(2/35) Installing ncurses-libs (5.9-r3)
(3/35) Installing readline (6.3.008-r0)
(4/35) Installing bash (4.3.33-r0)
(5/35) Installing dmidecode (2.12-r0)
(6/35) Installing libconfig (1.4.9-r1)
(7/35) Installing libnl (1.1.4-r0)
(8/35) Installing open-lldp (0.9.45-r2)
(9/35) Installing fuse (2.9.4-r0)
(10/35) Installing libgcc (4.9.2-r5)
(11/35) Installing libffi (3.2.1-r0)
(12/35) Installing libintl (0.19.4-r1)
(13/35) Installing glib (2.44.0-r1)
(14/35) Installing libstdc++ (4.9.2-r5)
(15/35) Installing icu-libs (55.1-r1)
(16/35) Installing libproc (3.3.9-r0)
(17/35) Installing libcom_err (1.42.13-r0)
(18/35) Installing krb5-conf (1.0-r0)
(19/35) Installing keyutils-libs (1.5.9-r1)
(20/35) Installing libverto (0.2.5-r0)
(21/35) Installing krb5-libs (1.13.1-r1)
(22/35) Installing libtirpc (0.3.0-r1)
(23/35) Installing open-vm-tools (9.4.6_p1770165-r4)
Executing open-vm-tools-9.4.6_p1770165-r4.pre-install
(24/35) Installing gdbm (1.11-r0)
(25/35) Installing yaml (0.1.6-r1)
(26/35) Installing ruby-libs (2.2.2-r0)
(27/35) Installing ruby (2.2.2-r0)
(28/35) Installing ruby-irb (2.2.2-r0)
(29/35) Installing sed (4.2.2-r0)
(30/35) Installing sudo (1.8.15-r0)
(31/35) Installing libuuid (2.26.2-r0)
(32/35) Installing libblkid (2.26.2-r0)
(33/35) Installing libmount (2.26.2-r0)
(34/35) Installing ncurses-widec-libs (5.9-r3)
(35/35) Installing util-linux (2.26.2-r0)
Executing busybox-1.23.2-r0.trigger
Executing glib-2.44.0-r1.trigger
OK: 63 MiB in 50 packages
fetch http://dl-3.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
fetch http://alpine.gliderlabs.com/alpine/v3.2/main/x86_64/APKINDEX.tar.gz
(1/2) Installing ipmitool (1.8.13-r0)
(2/2) Installing lshw (02.17-r1)
Executing busybox-1.23.2-r0.trigger
OK: 70 MiB in 52 packages
Successfully installed facter-2.4.4
Successfully installed json_pure-1.8.3
Successfully installed daemons-1.2.3
3 gems installed
---> 5aa504735ef6
Removing intermediate container ce0e2c660da7
Step 2 : ADD hnl_mk*.rb /usr/local/bin/
---> ca015e022414
Removing intermediate container 5091688d8476
Step 3 : ADD hanlon_microkernel/*.rb /usr/local/lib/ruby/hanlon_microkernel/
---> e9629590fd4e
Removing intermediate container 0591b9c10bc7
Successfully built e9629590fd4e
and the second to actually save that Docker image to a tarfile that can be used with the hanlon image add -t mk ...
command (or it's RESTful equivalent):
$ docker save hanlon-mk-image:3.0.0 > hanlon-mk-image.tar
Note that the example shown here was run from a clone of the Hanlon-Microkernel repository who's current release was tagged as v3.0.0 (resulting in a Docker image named hanlon-mk-image
and tagged 3.0.0
).
The two commands shown above (the docker build ...
command followed by the docker save ...
command) result in a tarfile that can be used 'as-is' as the input to a hanlon add -t mk ...
command (or it's RESTful equivalent). Alternatively, that tarfile could be either gzipped (using the gzip
command) or bzipped (using the bzip2
command), and the gzipped or bzipped Docker image file can be used as input to a hanlon image add -t mk ...
command if you are interested in saving space and/or bandwidth on your Hanlon server (or speeding up the Microkernel boot process).