From 36f837a6244ccc65f1890c25bca7fd5815bfe6de Mon Sep 17 00:00:00 2001 From: Scott Henderson Date: Tue, 2 Jul 2024 13:07:41 -0700 Subject: [PATCH] fix multiarch tagging --- .github/workflows/Build.yml | 4 ++-- .github/workflows/Publish.yml | 34 ++++++++-------------------------- .github/workflows/Test.yml | 4 ++-- 3 files changed, 12 insertions(+), 30 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 84798c8e..9d797884 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -52,7 +52,7 @@ jobs: password: ${{ secrets.QUAY_TOKEN }} - name: Build and push - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: ${{ env.IMAGE }} platforms: linux/amd64,linux/arm64 @@ -110,7 +110,7 @@ jobs: password: ${{ secrets.QUAY_TOKEN }} - name: Build and push - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: ${{ matrix.IMAGE }} push: true diff --git a/.github/workflows/Publish.yml b/.github/workflows/Publish.yml index c0f4d01d..90f07bb7 100644 --- a/.github/workflows/Publish.yml +++ b/.github/workflows/Publish.yml @@ -17,15 +17,6 @@ jobs: fail-fast: false matrix: IMAGE: [base-image, base-notebook, pangeo-notebook, ml-notebook, pytorch-notebook] - platform: [linux/amd64] - # Extra CPU architectures for specific images - include: - - IMAGE: "base-image" - platform: "linux/arm64" - - IMAGE: "base-notebook" - platform: "linux/arm64" - - IMAGE: "pangeo-notebook" - platform: "linux/arm64" name: ${{ matrix.IMAGE }} runs-on: ubuntu-latest steps: @@ -64,23 +55,14 @@ jobs: username: ${{ secrets.QUAY_USER }} password: ${{ secrets.QUAY_TOKEN }} - - name: Pull Image for Corresponding GitHub Commit + - name: Create New DockerHub Tags run: | - docker pull --platform ${{ matrix.platform }} ${DOCKER_ORG}/${{ matrix.IMAGE }}:${SHA7} + docker buildx imagetools create ${DOCKER_ORG}/${{ matrix.IMAGE }}:${SHA7} \ + -t ${DOCKER_ORG}/${{ matrix.IMAGE }}:latest \ + -t ${DOCKER_ORG}/${{ matrix.IMAGE }}:${TAG} - - name: Retag Images + - name: Create New Quay.io Tags run: | - docker tag ${DOCKER_ORG}/${{ matrix.IMAGE }}:${SHA7} ${DOCKER_ORG}/${{ matrix.IMAGE }}:latest - docker tag ${DOCKER_ORG}/${{ matrix.IMAGE }}:${SHA7} ${DOCKER_ORG}/${{ matrix.IMAGE }}:${TAG} - docker tag ${DOCKER_ORG}/${{ matrix.IMAGE }}:${SHA7} quay.io/${DOCKER_ORG}/${{ matrix.IMAGE }}:latest - docker tag ${DOCKER_ORG}/${{ matrix.IMAGE }}:${SHA7} quay.io/${DOCKER_ORG}/${{ matrix.IMAGE }}:${TAG} - - - name: Push Tags to Docker Hub - run: | - docker push --platform ${{ matrix.platform }} ${DOCKER_ORG}/${{ matrix.IMAGE }}:latest - docker push --platform ${{ matrix.platform }} ${DOCKER_ORG}/${{ matrix.IMAGE }}:${TAG} - - - name: Push Tags To Quay.io - run: | - docker push --platform ${{ matrix.platform }} quay.io/${DOCKER_ORG}/${{ matrix.IMAGE }}:latest - docker push --platform ${{ matrix.platform }} quay.io/${DOCKER_ORG}/${{ matrix.IMAGE }}:${TAG} + docker buildx imagetools create quay.io/${DOCKER_ORG}/${{ matrix.IMAGE }}:${SHA7} \ + -t quay.io/${DOCKER_ORG}/${{ matrix.IMAGE }}:latest \ + -t quay.io/${DOCKER_ORG}/${{ matrix.IMAGE }}:${TAG} \ No newline at end of file diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index d5fac077..c9973509 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -51,7 +51,7 @@ jobs: driver-opts: network=host - name: Build base-image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: base-image platforms: linux/amd64,linux/arm64 @@ -61,7 +61,7 @@ jobs: cache-to: type=gha,mode=max - name: Build Only - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: ${{ matrix.IMAGE }} platforms: linux/amd64,linux/arm64