Skip to content

Commit a7752b1

Browse files
committed
fix: fix building the manifest
1 parent ae6be7b commit a7752b1

1 file changed

Lines changed: 8 additions & 28 deletions

File tree

.github/workflows/workflows.yaml

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -130,32 +130,12 @@ jobs:
130130
username: ${{ secrets.acr-username }}
131131
password: ${{ secrets.acr-password }}
132132

133-
- name: Create and push manifest
134-
id: manifest
133+
- name: Build manifest
134+
shell: bash
135135
run: |
136-
IMAGE=${{ needs.docker-amd64.outputs.image }}
137-
CLEAN_TAG=${{ needs.docker-amd64.outputs.clean-tag }}
138-
FINAL_TAG="${IMAGE}:${CLEAN_TAG}"
139-
140-
# Enable experimental features for manifest command
141-
export DOCKER_CLI_EXPERIMENTAL=enabled
142-
143-
echo "Creating manifest for ${FINAL_TAG}"
144-
145-
# Create the manifest
146-
docker manifest create ${FINAL_TAG} \
147-
${IMAGE}@${{ needs.docker-amd64.outputs.digest }} \
148-
${IMAGE}@${{ needs.docker-arm64.outputs.digest }}
149-
150-
# Add architecture annotations
151-
docker manifest annotate ${FINAL_TAG} \
152-
${IMAGE}@${{ needs.docker-amd64.outputs.digest }} --arch amd64
153-
docker manifest annotate ${FINAL_TAG} \
154-
${IMAGE}@${{ needs.docker-arm64.outputs.digest }} --arch arm64
155-
156-
# Push the manifest
157-
docker manifest push ${FINAL_TAG}
158-
159-
echo "tag=${FINAL_TAG}" >> $GITHUB_OUTPUT
160-
echo "Multi-arch manifest created and pushed: ${FINAL_TAG}"
161-
shell: bash
136+
TAG=${{ needs.docker-amd64.outputs.tag }}
137+
TAG=${TAG#${{ needs.docker-amd64.outputs.image }}:${{ needs.docker-amd64.outputs.tag-prefix }}}
138+
DIGEST_ARM64=$(docker manifest inspect ${{ needs.docker-arm64.outputs.tag }} | jq -r '.manifests[] | select(.platform.architecture=="arm64") | .digest')
139+
DIGEST_AMD64=$(docker manifest inspect ${{ needs.docker-amd64.outputs.tag }} | jq -r '.manifests[] | select(.platform.architecture=="amd64") | .digest')
140+
docker manifest create ${{ needs.docker-amd64.outputs.image }}:${TAG} ${{ needs.docker-arm64.outputs.image }}@${DIGEST_ARM64} ${{ needs.docker-amd64.outputs.image }}@${DIGEST_AMD64}
141+
docker manifest push ${{ needs.docker-amd64.outputs.image }}:${TAG}

0 commit comments

Comments
 (0)