From 4c8212fc9a85c30b9185bbc30d19b0c01e2d18ea Mon Sep 17 00:00:00 2001 From: Martin Perina Date: Wed, 27 Mar 2024 17:49:51 +0100 Subject: [PATCH] Build container images inside CS9 container To mitigate issues around different buildah versions between Fedora/CS9 and Ubuntu, let's build images inside CS9 container. Signed-off-by: Martin Perina --- .github/workflows/images.yml | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/images.yml b/.github/workflows/images.yml index 1ce61273dc..5ddb108c68 100644 --- a/.github/workflows/images.yml +++ b/.github/workflows/images.yml @@ -14,15 +14,38 @@ on: jobs: build_container: runs-on: ubuntu-latest + container: + image: quay.io/centos/centos:stream9 + options: --security-opt=seccomp:unconfined --security-opt=label:disable --device /dev/fuse steps: + # Specific steps taken from https://developers.redhat.com/blog/2019/08/14/best-practices-for-running-buildah-in-a-container#setup + - name: Install dependencies + run: | + dnf install \ + buildah \ + fuse-overlayfs \ + --exclude container-selinux \ + -y + + - name: Adjust configuration + run: | + sed -i \ + -e 's|^#mount_program|mount_program|g' \ + -e '/additionalimage.*/a "/var/lib/shared",' \ + /etc/containers/storage.conf + mkdir -p \ + /var/lib/shared/overlay-images \ + /var/lib/shared/overlay-layers + touch /var/lib/shared/overlay-images/images.lock + touch /var/lib/shared/overlay-layers/layers.lock + - name: Checkout sources uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Build manifest run: | + export _BUILDAH_STARTED_IN_USERNS="" + export BUILDAH_ISOLATION=chroot ./build-scripts/build-push-containers.sh ${{ inputs.image }} - name: Push manifest o quay.io