From 39adfd144a2d2272c63411d1b1a27342a1361a55 Mon Sep 17 00:00:00 2001 From: Paul Larson Date: Fri, 22 Nov 2024 08:49:39 -0600 Subject: [PATCH] Build different versions of the testenv container --- .../build-testflinger-testenv-container.yml | 12 ++++++++++++ agent/extra/testflinger-testenv/Dockerfile | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-testflinger-testenv-container.yml b/.github/workflows/build-testflinger-testenv-container.yml index 14d71744..2e5f5269 100644 --- a/.github/workflows/build-testflinger-testenv-container.yml +++ b/.github/workflows/build-testflinger-testenv-container.yml @@ -20,6 +20,14 @@ jobs: contents: read packages: write + strategy: + matrix: + base_version: [focal, jammy, noble] + base_image: + focal: ubuntu:focal + jammy: ubuntu:jammy + noble: ubuntu:noble + steps: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -43,6 +51,8 @@ jobs: uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.base_version }} - name: Build and push backend Docker image uses: docker/build-push-action@v6 @@ -51,3 +61,5 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + build-args: | + BASE_IMAGE=${{ matrix.base_image }} diff --git a/agent/extra/testflinger-testenv/Dockerfile b/agent/extra/testflinger-testenv/Dockerfile index 5a6d84eb..86b44d72 100644 --- a/agent/extra/testflinger-testenv/Dockerfile +++ b/agent/extra/testflinger-testenv/Dockerfile @@ -1,4 +1,5 @@ -FROM ubuntu:20.04 +ARG BASE_IMAGE=ubuntu:20.04 +FROM ${BASE_IMAGE} ENV container docker RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common expect sudo openssh-client virtualenv curl wget build-essential python3-setuptools python3-dev python3-pip python3-requests python3-psutil git RUN pip3 install PyYaml netifaces