On Tue, Jun 12, 2018 at 12:12:12PM +0200, Andrea Bolognani wrote:
Instead of starting from the minimal Ubuntu 18.04 base
image and installing all requirements at build time,
use a Docker image that has been specifically tailored
at building libvirt and thus already includes all
required packages.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
The pre-built images have been hand-crafted using the
build dependencies recorded in the libvirt-jenkins-ci
repository: of course that's not something that we want
to keep doing manually going forward, so figuring out a
sensible way to generate Dockerfiles and potentially
even Docker images automatically is pretty high on the
priority list.
When first testing I produced a custom Ubuntu docker image
with not much effort. I was just creating a file in
"libvirt-jenkins-ci" repo called "images/ubuntu-18.04.docker"
that contains
FROM ubuntu:18.04
RUN apt-get update
ENV PACKAGES \
::PACKAGE-LIST:: \
RUN apt-get -y install $PACKAGES
RUN mkdir /build
WORKDIR /build
::PACKAGE-LIST:: can be built by reading the
guests/vars/projects/libvirt.yml file, and then
expanding it based on guest/vars/mappings.yml
I hadn't written code for that bit, but it just
needs a short python script to read the two
yaml files and map the data sets.
I was only going to do packages forthe libvirt.yml,
but we can expand to cover the other modules too
quite easily, as its just taking the union of all
the project files.
Other distros are just the same but change the
name of the pkg manager command.
diff --git a/.travis.yml b/.travis.yml
index f62e8c6437..1b0d1e824b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,7 +10,7 @@ matrix:
- services:
- docker
env:
- - IMAGE=ubuntu:18.04
+ - IMAGE="ubuntu-18"
- DISTCHECK_CONFIGURE_FLAGS="--with-init-script=systemd"
- compiler: clang
language: c
@@ -22,13 +22,11 @@ matrix:
script:
- docker run
- --privileged
-v $(pwd):/build
-w /build
-e VIR_TEST_DEBUG="$VIR_TEST_DEBUG"
- -e PACKAGES="$PACKAGES"
-e DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS"
- "$IMAGE"
+ "libvirt/build:$IMAGE"
This is a pretty alien approach to take for docker images.
This defines an image called 'libvirt/build' and then uses a
tag to identify different distros. The normal practice is
for tags to identify different versions of the same distro.
Using tags for completely different distros, fedora vs ubuntu,
on the same image name is not something I'd expect.
ie rather than
Name: libvirt/build
Tag: ubuntu-18.04
we should have
Name: libvirt/ubuntu
Tag: 18.04
Though perhaps make clear it is for CI, so
Name: libvirt/ci-ubuntu
Tag: 18.04
Annoyingly you can't use '/' in an image name to create a
multilevel namespace, so we have to include 'ci' to either
the image name or organization name.
Regards,
Daniel
--
|:
https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|:
https://libvirt.org -o-
https://fstop138.berrange.com :|
|:
https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|