For those who never heard about it, KIWI is a tool which creates Linux systems for both physical and virtual machines. It can create openSUSE, SUSE and other types of Linux distributions.
Update: I changed the required version of kiwi and the openSUSE 13.1 template. Kiwi just received some improvements which do no longer force the image to include the lxc package.
Why is this important?
As you might know Docker has already its build system which provides a really easy way to create new images. However these images must be based on existing ones, which leads to the problem of creating the 1st parent image. That’s where KIWI comes to the rescue.
Indeed Kiwi can be used to build the openSUSE/SUSE/whatever docker images that are going to act as the foundation blocks of other ones.
Docker support has been added to KIWI 5.06.87. You can find this package inside of the Virtualization:Appliances project on OBS.
kiwi and the
kiwi-doc packages on your system. Then go to the
/usr/share/doc/packages/kiwi/examples/ directory where you will find a simple
openSUSE 13.1 template.
Building the system
Just copy the whole
directory to another location and make your changes.
The heart of the whole image is the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
This is a really minimal image which contains just a bunch of packages.
The first step is the creation of the image’s root system:
The next step compresses the file system of the image into a single tarball:
The tarball can be found under
/tmp/myimage-result. This can be imported
into docker using the following command:
The image named
myImage is now ready to be used.
In the next days I’ll make another blog post explaining how to build docker images using KIWI and the Open Build Service. This is a powerful combination which allows to achieve continuous delivery.
Stay tuned and have fun!