Skip to content

Commit

Permalink
Fixes for multiarch docker image tagging (#566)
Browse files Browse the repository at this point in the history
fix multiarch tagging
  • Loading branch information
scottyhq authored Jul 2, 2024
1 parent 1beeb67 commit df1786d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
34 changes: 8 additions & 26 deletions .github/workflows/Publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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}
4 changes: 2 additions & 2 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit df1786d

Please sign in to comment.