Public Repository

Last pushed: 2 years ago
Short Description
everything needed to build (and customize) x86-64-cirros images
Full Description

about CirrOS

From the CirrOS project page:

"CirrOS is a Tiny OS that specializes in running on a cloud."

The current container uses CirrOS 0.3.3.

The Dockerfile can be found in a GitHub repo.

about the build environment

Currently only the x86_64 target is supported using the following main components:

  • buildroot 2015.2
  • uClib 0.33.2
  • busybox 1.23.1
  • gcc 4.8.4

Since the build-image script (/bin/bundle) uses loop-mounts the container must be started in privileged mode.

The configuration and build process is supported by some convenience scripts:

  • cirros-config-image - config buildroot environment
  • cirros-config-image-busybox - configure busybox used within cirros
  • cirros-build - build cirros firmware
  • cirros-build-image - build cirros images

NOTE: The first run of 'cirros-build-image' triggers the download of an additional grub package.

To make the generated images easily available on the host machine you may
start the instance with a shared directory attached (see example below).

The sources of CirrOS and buildroot are located in /root/source.

The build process takes place in /root/build.


Get the container:

host> docker pull hecke/cirros_x86_64_builder

Start the instance:

host> docker run --privileged -i -v /tmp/cirros_img/:/root/build/cirros-0.3.3/output/x86_64/images/ -t hecke/cirros_x86_64_builder

Build the cirros image:

root@667d9cbe3a20:~/build/cirros-0.3.3# cirros-build-image
wrote /root/build/cirros-0.3.3/output/x86_64/images/part.img
wrote /root/build/cirros-0.3.3/output/x86_64/images/disk.img
wrote /root/build/cirros-0.3.3/output/x86_64/images/kernel
wrote /root/build/cirros-0.3.3/output/x86_64/images/initramfs
wrote /root/build/cirros-0.3.3/output/x86_64/images/blank.img
wrote /root/build/cirros-0.3.3/output/x86_64/images/filesys.tar.gz

NOTE: The format of 'disk.img' is qcow2.

Run CirrOS using qemu:

host> sudo qemu-system-x86_64 -curses /tmp/cirros_img/disk.img

Create a VM using the CirrOS-image and libvirt:

host> virt-install --connect qemu:///system --virt-type qemu --arch x86_64 --name cirros --ram 64 --disk path=/tmp/cirros_img/disk.img,format=qcow2 --boot hd --vnc --network network=default,mac=52:54:00:9c:42:23 --os-type linux
Docker Pull Command