alastair
22 April 2016
- Log in to post comments
Docker is a great way to fully describe and implement an installed Linux environment, and we make use of it at work as part of our continuous integration system to provide a clean environment for the jobs that we run.Unfortunately, the main public repo (docker.io) currently only contains images for x64, so if you want a different architecture, you may need to build it yourself.
In this situation, I required a Fedora 23 image on Power PC. I started with a working Fedora 23 in PowerKVM.
The problems I had to address:
- You can't run nested KVM instances, and imagefactory wants to use it by default
- Passing the proxy settings to the guest environment has to be done via a kernel parameter
- Only the nominated .ks file iss passed to the installation environment (files that are included are not available)
So, assuming you are logged in to a working Power environment:
- git clone https://git.fedorahosted.org/git/spin-kickstarts.git
- cd spin-kickstarts
- cp fedora-docker-base.ks fedora-docker-ppc.ks
- merge in the contents of fedora-docker-base-ppc.ks to fedora-docker-ppc.ks (only the first .ks file is passed to the install environment, so includes do not seem to work)
- dnf install yum-utils koji-builder strace mock kernel-firmware ntp ntpdate rsyslog oz imagefactory imagefactory-plugins-TinMan imagefactory-plugins-Docker imagefactory-plugins-vSphere imagefactory-plugins-ovfcommon imagefactory-plugins imagefactory-plugins-OVA imagefactory-plugins-EC2 imagefactory-plugins-RHEVM python-psphere VMDKstream pykickstart
- edit /etc/oz/oz.cfg and set the virtualisation type to 'qemu'
- create ../fedora-23.tdl (documented here):
<template>
<name>rawhide</name>
<os>
<name>Fedora</name>
<version>23</version>
<arch>ppc64le</arch>
<install type='url'>
<url>https://dl.fedoraproject.org/pub/fedora-secondary/releases/23/Cloud/ppc64le/os</url>
</install>
<kernelparam>proxy=http://<proxy server>:<proxy port></kernelparam>
</os>
</template> - imagefactory --debug target_image --template ../fedora-23.tdl --parameter offline_icicle true --file-parameter install_script $(pwd)/fedora-docker-ppc.ks docker
- This should have created a file like /var/lib/imagefactory/storage/<some hash>.body
- docker load --input /var/lib/imagefactory/storage/<some hash>.body
- docker images (your new image will be called rawhide:latest)
- docker tag <id> fedora:23
- docker tag <id> fedora:latest
- docker tag <id> fedora:rawhide
- docker run fedora:23 ls