From c2cdefd06d89f4510dfe06508eee7ea5aa49d607 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 3 Sep 2026 11:35:26 -0700 Subject: [PATCH] docker release: take the index digest from the create result imagetools create writes the descriptor it pushed with --metadata-file (buildx 0.32+, the runners ship 0.36), so the digest no longer comes from re-resolving the tag even within the same step. Claude-Session: https://claude.ai/code/session_01A5zMqzaUg1Snur4Yg8xJGa --- .github/workflows/container_latest.yml | 5 +++-- .github/workflows/container_release_unified.yml | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/container_latest.yml b/.github/workflows/container_latest.yml index 488d97eaa..cedfa27d7 100644 --- a/.github/workflows/container_latest.yml +++ b/.github/workflows/container_latest.yml @@ -501,12 +501,13 @@ jobs: # Create manifest on GHCR first (no rate limits) echo "Creating GHCR manifest (no rate limits)..." docker buildx imagetools create -t ghcr.io/chrislusf/seaweedfs:${BASE_TAG}${SUFFIX} \ + --metadata-file /tmp/manifest.json \ ghcr.io/chrislusf/seaweedfs:${BASE_TAG}${SUFFIX}-amd64 \ ghcr.io/chrislusf/seaweedfs:${BASE_TAG}${SUFFIX}-arm64 \ ghcr.io/chrislusf/seaweedfs:${BASE_TAG}${SUFFIX}-arm \ ghcr.io/chrislusf/seaweedfs:${BASE_TAG}${SUFFIX}-386 - # The copy and the signature below use this digest, not whatever the tag points at by then. - DIGEST=$(docker buildx imagetools inspect --format '{{.Manifest.Digest}}' ghcr.io/chrislusf/seaweedfs:${BASE_TAG}${SUFFIX}) + # The copy and the signature below use the digest this run pushed, not whatever the tag points at by then. + DIGEST=$(jq -er '."containerimage.descriptor".digest' /tmp/manifest.json) echo "digest=${DIGEST}" >> "$GITHUB_OUTPUT" # Copy the complete multi-arch image from GHCR to Docker Hub diff --git a/.github/workflows/container_release_unified.yml b/.github/workflows/container_release_unified.yml index 64831a4e0..007b259f6 100644 --- a/.github/workflows/container_release_unified.yml +++ b/.github/workflows/container_release_unified.yml @@ -347,10 +347,12 @@ jobs: run: | docker buildx imagetools create \ -t ${{ env.IMAGE }}:${{ env.RELEASE_TAG }}${{ matrix.tag_suffix }} \ + --metadata-file /tmp/manifest.json \ $(printf '${{ env.IMAGE }}@sha256:%s ' *) docker buildx imagetools inspect ${{ env.IMAGE }}:${{ env.RELEASE_TAG }}${{ matrix.tag_suffix }} - # The copy and the signature below use this digest, not whatever the tag points at by then. - echo "digest=$(docker buildx imagetools inspect --format '{{.Manifest.Digest}}' ${{ env.IMAGE }}:${{ env.RELEASE_TAG }}${{ matrix.tag_suffix }})" >> "$GITHUB_OUTPUT" + # The copy and the signature below use the digest this run pushed, not whatever the tag points at by then. + digest=$(jq -er '."containerimage.descriptor".digest' /tmp/manifest.json) + echo "digest=${digest}" >> "$GITHUB_OUTPUT" - name: Login to Docker Hub if: github.event_name != 'workflow_dispatch' || github.event.inputs.variant == 'all' || github.event.inputs.variant == matrix.variant