From 2a394f59f192ddd88e4c3fe59e6227d7385f479e Mon Sep 17 00:00:00 2001 From: Ruben Simons Date: Wed, 13 Sep 2023 13:02:19 +0200 Subject: [PATCH] closes #366 As #367 got reverted, I wanted to submit this again in order to get multi-arch builds to work --- .github/workflows/pulp_images.yml | 12 +++++++----- CHANGES/366.feature | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 CHANGES/366.feature diff --git a/.github/workflows/pulp_images.yml b/.github/workflows/pulp_images.yml index 6a7b8476..f8ecab15 100644 --- a/.github/workflows/pulp_images.yml +++ b/.github/workflows/pulp_images.yml @@ -103,8 +103,9 @@ jobs: run: | podman version buildah version - podman build --format docker --file images/Containerfile.core.base --tag pulp/base:${TEMP_BASE_TAG} . - podman build --format docker --file images/pulp_ci_centos/Containerfile --tag pulp/pulp-ci-centos:${TEMP_BASE_TAG} --build-arg FROM_TAG=${TEMP_BASE_TAG} . + sudo podman run --rm --privileged multiarch/qemu-user-static --reset -p yes + podman build --platform linux/arm64,linux/amd64,linux/ppc64le --format docker --file images/Containerfile.core.base --tag pulp/base:${TEMP_BASE_TAG} . + podman build --platform linux/arm64,linux/amd64,linux/ppc64le --format docker --file images/pulp_ci_centos/Containerfile --tag pulp/pulp-ci-centos:${TEMP_BASE_TAG} --build-arg FROM_TAG=${TEMP_BASE_TAG} . # we use the docker format (default), even though it may not be the fastest, # because it supports saving both images at once. # However, it seems to export the common layers twice. @@ -212,11 +213,12 @@ jobs: run: | podman version buildah version + sudo podman run --rm --privileged multiarch/qemu-user-static --reset -p yes if [[ "${{ matrix.app.image_name }}" == "pulp-minimal" || "${{ matrix.app.image_name }}" == "galaxy-minimal" ]]; then - podman build --format docker --pull=false --file images/${{ matrix.app.image_name }}/${{ matrix.image_variant }}/Containerfile.core --tag pulp/${{ matrix.app.image_name }}:${TEMP_APP_TAG} --build-arg FROM_TAG=${TEMP_BASE_TAG} . - podman build --format docker --pull=false --file images/${{ matrix.app.image_name }}/${{ matrix.image_variant }}/Containerfile.webserver --tag pulp/${{ matrix.app.web_image }}:${TEMP_APP_TAG} --build-arg FROM_TAG=${TEMP_APP_TAG} . + podman build --platform linux/arm64,linux/amd64,linux/ppc64le --format docker --pull=false --file images/${{ matrix.app.image_name }}/${{ matrix.image_variant }}/Containerfile.core --tag pulp/${{ matrix.app.image_name }}:${TEMP_APP_TAG} --build-arg FROM_TAG=${TEMP_BASE_TAG} . + podman build --platform linux/arm64,linux/amd64,linux/ppc64le --format docker --pull=false --file images/${{ matrix.app.image_name }}/${{ matrix.image_variant }}/Containerfile.webserver --tag pulp/${{ matrix.app.web_image }}:${TEMP_APP_TAG} --build-arg FROM_TAG=${TEMP_APP_TAG} . else - podman build --format docker --pull=false --file images/${{ matrix.app.image_name }}/${{ matrix.image_variant }}/Containerfile --tag pulp/${{ matrix.app.image_name }}:${TEMP_APP_TAG} --build-arg FROM_TAG=${TEMP_BASE_TAG} . + podman build --platform linux/arm64,linux/amd64,linux/ppc64le --format docker --pull=false --file images/${{ matrix.app.image_name }}/${{ matrix.image_variant }}/Containerfile --tag pulp/${{ matrix.app.image_name }}:${TEMP_APP_TAG} --build-arg FROM_TAG=${TEMP_BASE_TAG} . fi podman images -a diff --git a/CHANGES/366.feature b/CHANGES/366.feature new file mode 100644 index 00000000..c0fb2bff --- /dev/null +++ b/CHANGES/366.feature @@ -0,0 +1 @@ +Enable multi-platform build