We were sitting at “Modularity UX feedback” session at Flock 2017. Sinny Kumari
raised an interesting question: “Can I create a container image with modular OS
locally myself?“. Sinny wanted to try the modular OS on different CPU
The container image can be created using Image Factory, which can be really
tough to set up.
I’m so glad that platform team already solved this problem during development
of Boltron in their GitHub repo
They created a neat way of creating a docker base image from scratch using mock.
In order to do this, you should follow the instructions from
of the repo. Before running
avocado run setup.py, we need to change configuration
of mock because by default it uses Boltron (F26) repos and targets x86_64.
I did this on my Raspberry Pi. The configuration is present in
I targeted arm CPU architecture:
-config_opts['target_arch'] = 'x86_64' -config_opts['legal_host_arches'] = ('x86_64',) +config_opts['target_arch'] = 'armhfp' +config_opts['legal_host_arches'] = ('armhfp', 'armv7l' )
I used Modular Rawhide compose repo:
Modular dnf is still not available in mainline. Martin is providing the RPM via
his COPR repo
The important note is that the modular DNF is only available for architectures
Let’s build the image!
$ sudo python2 ./setup.py ... Successfully built dac3c6598bef command 'docker rmi base-runtime-smoke-scratch' succeeded with output: Untagged: base-runtime-smoke-scratch:latest PASS 1-./setup.py:BaseRuntimeSetupDocker.testCreateDockerImage Test results available in /tmp/avocado_avocado.core.jobwv6R1t
Once the build is done, we can try it out:
$ sudo docker run --rm -ti base-runtime-smoke-scratch:latest bash bash-4.4# cat /etc/system-release Fedora modular release 27 (Twenty Seven) bash-4.4# uname -i armv7l
Once the patches for modular DNF are in mainline, this will be a lot more interesting!
Source From: fedoraplanet.org.
Original article title: Tomas Tomecek: Building container image with modular OS from scratch.
This full article can be read at: Tomas Tomecek: Building container image with modular OS from scratch.