Skip to content

Commit 6f07c01

Browse files
committed
Create manifests locally before pushing to Docker Hub
Replace the deploy-side use of `docker buildx imagetools create` with a local `docker manifest create` followed by authenticated `docker manifest push`. This keeps the manifest assembly step anonymous and delays Docker Hub login until the actual publish step, which reduces authenticated rate-limit failures during multi-arch manifest publication.
1 parent 50e6cee commit 6f07c01

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

.github/workflows/build.yaml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,21 +97,25 @@ jobs:
9797
fail-fast: false
9898
matrix: ${{ fromJSON(needs.generate-matrix.outputs.version_matrix) }}
9999
steps:
100-
- name: Set up Docker Buildx
101-
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
100+
- name: Create local multi-arch manifest
101+
run: |
102+
refs=("${IMAGE_NAME}:${{ matrix.key }}-amd64")
103+
if echo '${{ toJSON(matrix.platforms) }}' | jq -e '.[] == "linux/arm64"' > /dev/null; then
104+
refs+=("${IMAGE_NAME}:${{ matrix.key }}-arm64")
105+
fi
106+
docker manifest create "${IMAGE_NAME}:${{ matrix.key }}" "${refs[@]}"
107+
102108
- name: Login to Docker Hub
103109
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4
104110
with:
105111
username: ${{ secrets.DOCKERHUB_USERNAME }}
106112
password: ${{ secrets.DOCKERHUB_TOKEN }}
107113

108-
- name: Publish multi-arch manifest
109-
run: |
110-
tags=("${IMAGE_NAME}:${{ matrix.key }}-amd64")
111-
if echo '${{ toJSON(matrix.platforms) }}' | jq -e '.[] == "linux/arm64"' > /dev/null; then
112-
tags+=("${IMAGE_NAME}:${{ matrix.key }}-arm64")
113-
fi
114-
docker buildx imagetools create --tag "${IMAGE_NAME}:${{ matrix.key }}" "${tags[@]}"
114+
- name: Push multi-arch manifest
115+
run: docker manifest push "${IMAGE_NAME}:${{ matrix.key }}"
116+
117+
- name: Set up Docker Buildx
118+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
115119

116120
- name: Add digest to build context
117121
run: |

0 commit comments

Comments
 (0)