Lately I had a chance to refine our docker files and setup a build process in docker hub to build and publish OSv builder images:
As you can see there are 2 images - one based on Fedora 31 and another on Ubuntu 19.10 - that are built and published to docker hub and automatically triggered
You can also see them here after you click on that green check left to the 'Latest commit ...':
The images are built on docker hub infrastructure based on these docker files -
They have the 'base' prefix in name for a reason - each is tailored to a specific Linux distribution and roughly is made of the packages installed by setup.py and capstan binary. Also both of them take an input argument - DIST_VERSION - which allows building images specific for arbitrary version of Fedora or Ubuntu (the default is 29 for fedora and 19.04 for ubuntu) like in this example:
docker build -t osvunikernel/osv-fedora-31-builder-base -f Dockerfile.builder-fedora-base --build-arg DIST_VERSION=31 .
ARG DIST="fedora-29"
FROM osvunikernel/osv-${DIST}-builder-base
# - prepare directories
RUN mkdir -p /git-repos
# - clone OSv
WORKDIR /git-repos
ARG GIT_ORG_OR_USER=cloudius-systems
WORKDIR /git-repos/osv
RUN git submodule update --init --recursive
# - update all required packages in case they have changed
RUN scripts/setup.py
CMD /bin/bash
As you can see it also takes an input argument letting one specify which distribution to use like in this example:
docker build -t osv/builder-fedora-31 -f Dockerfile.builder --build-arg DIST="fedora-31" --build-arg GIT_ORG_OR_USER=a_user .
Now what is the advantage of docker and the distribution base images that get published on each commit? For anyone that has OSv setup on their favorite distribution there is not much advantage out right. But what if I have Ubuntu and wanted to test OSv on Fedora or vice versa? Or wanted to test on different version of Ubuntu because it has newer gcc or qemu? That is where docker images and containers to build and run OSv in it become really handy.
Finally we .travis.yml also uses Dockerfile.builder that in turn relies on pre-built base build image and that speeds up the entire new CI process which I will describe in my next email.
I hope you will find it useful,
Waldek