Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for multiarch docker image tagging #566

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading