From 9dea35cbbccfbe3e25da818cad1cc1d89f837c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 19 Jan 2024 16:09:36 +0100 Subject: [PATCH] use docker buildx imagetools for creating the multi-platform Docker images --- .../workflows/build-publish-containers.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-publish-containers.yml b/.github/workflows/build-publish-containers.yml index c28ff134..ec2bcd9f 100644 --- a/.github/workflows/build-publish-containers.yml +++ b/.github/workflows/build-publish-containers.yml @@ -82,8 +82,8 @@ jobs: rm -rf /tmp/.buildx-cache mv /tmp/.buildx-cache-new /tmp/.buildx-cache - create_manifest: - name: Create the Docker manifest + create_multiplatform_image: + name: Create the multi-platform Docker image needs: build_and_publish runs-on: ubuntu-latest permissions: @@ -105,15 +105,14 @@ jobs: run: | echo REPOSITORY_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV - - name: Run docker manifest + - name: Create the final image using "docker buildx imagetools create" if: github.event_name != 'pull_request' run: | - docker manifest create \ - ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }} \ - --amend ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }}-amd64 \ - --amend ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }}-arm64 \ - --amend ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }}-ppc64le + docker buildx imagetools create -t ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }} \ + ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }}-amd64 \ + ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }}-arm64 \ + ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }}-ppc64le - - name: Push manifest + - name: Inspect the final image if: github.event_name != 'pull_request' - run: docker manifest push ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }} + run: docker buildx imagetools inspect ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }}