From c826db38e7e808ea451703fffca51c8b5686c9d9 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Thu, 19 Nov 2020 10:11:24 +0100 Subject: [PATCH] test: match container version to host Instead of just using the "latest" container everywhere, which will change every time a new release is made, add a build argument to specify the version and then match that version to the host in all the build scripts. This will make it possible to use the tests for gating, and ensure that we test the plugins on the OS version that is targeted. --- test/build-container.sh | 6 ++++-- test/container/builder/Dockerfile.fedora | 4 +++- test/container/builder/Dockerfile.rhel | 4 +++- test/container/hub/Dockerfile.fedora | 4 +++- test/container/hub/Dockerfile.rhel | 4 +++- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/test/build-container.sh b/test/build-container.sh index 7ee4c05..8243814 100755 --- a/test/build-container.sh +++ b/test/build-container.sh @@ -12,9 +12,11 @@ fi source /etc/os-release podman build \ + --build-arg version=${VERSION_ID} \ -t koji.hub \ -f ${TEST_PATH}/container/hub/Dockerfile.${ID} $TEST_PATH -podman build -t \ - koji.builder \ +podman build \ + --build-arg version=${VERSION_ID} \ + -t koji.builder \ -f ${TEST_PATH}/container/builder/Dockerfile.${ID} $TEST_PATH diff --git a/test/container/builder/Dockerfile.fedora b/test/container/builder/Dockerfile.fedora index 961d0fa..4cd9ebe 100644 --- a/test/container/builder/Dockerfile.fedora +++ b/test/container/builder/Dockerfile.fedora @@ -1,4 +1,6 @@ -FROM docker.io/library/fedora:latest +ARG version=latest + +FROM docker.io/library/fedora:$version RUN dnf -y upgrade \ && dnf -y \ diff --git a/test/container/builder/Dockerfile.rhel b/test/container/builder/Dockerfile.rhel index 7eec64d..7a3c182 100644 --- a/test/container/builder/Dockerfile.rhel +++ b/test/container/builder/Dockerfile.rhel @@ -1,4 +1,6 @@ -FROM registry.access.redhat.com/ubi8/ubi:latest +ARG version=latest + +FROM registry.access.redhat.com/ubi8/ubi:$version COPY container/rhel.repo /etc/yum.repos.d/ COPY container/brew.repo /etc/yum.repos.d/ diff --git a/test/container/hub/Dockerfile.fedora b/test/container/hub/Dockerfile.fedora index 10d4afd..0dad7a0 100644 --- a/test/container/hub/Dockerfile.fedora +++ b/test/container/hub/Dockerfile.fedora @@ -1,4 +1,6 @@ -FROM docker.io/library/fedora:latest +ARG version=latest + +FROM docker.io/library/fedora:$version # koji db schema is in docs, remove nodocs from from dnf config RUN sed -i '/^tsflags=nodocs$/d' /etc/dnf/dnf.conf diff --git a/test/container/hub/Dockerfile.rhel b/test/container/hub/Dockerfile.rhel index 86fb509..cb287a3 100644 --- a/test/container/hub/Dockerfile.rhel +++ b/test/container/hub/Dockerfile.rhel @@ -1,4 +1,6 @@ -FROM registry.access.redhat.com/ubi8/ubi:latest +ARG version=latest + +FROM registry.access.redhat.com/ubi8/ubi:$version COPY container/rhel.repo /etc/yum.repos.d/ COPY container/brew.repo /etc/yum.repos.d/