fix: resolve Docker multi-registry deployment issues#9
Merged
Conversation
Fix digest-based multi-arch builds for dual registry publishing (GHCR and Docker Hub). The issue was attempting to push images by digest to multiple registries simultaneously, which isn't supported. Docker BuildKit's push-by-digest mode works with a single canonical registry. Solution: - Push platform-specific images by digest to GHCR (primary registry) - In merge step, create multi-arch manifest referencing GHCR digests - Apply tags for both GHCR and Docker Hub in single imagetools command - BuildKit automatically handles copying layers to Docker Hub Changes: - Simplified build step to push only to GHCR with push-by-digest - Updated merge step to reference GHCR digests and tag both registries - Removed conflicting docker/metadata-action usage from build step - Kept OCI-compliant labels for image metadata This follows the recommended approach for multi-registry multi-arch builds as documented in Docker BuildKit best practices.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Docker Multi-Registry Deployment
This PR resolves issues with Docker multi-registry multi-arch builds that were failing in the release workflow.
Problem
The Docker build workflow was failing with errors when attempting to push images by digest to multiple registries simultaneously:
Root Cause
Docker BuildKit's
push-by-digest=truemode works with a single canonical registry. Attempting to push the same digest to multiple registries at once is not supported because:Solution
Implemented the recommended approach for multi-registry multi-arch builds:
Build Step (Per Platform)
Merge Step (Single Job)
Changes
.github/workflows/build-cli-docker.yml.github/workflows/release.ymlfix-releasebranch to triggers for testing (can be removed after merge)Testing
✅ Successfully tested on fix-release branch: https://github.com/techprimate/github-actions-utils-cli/actions/runs/19237095622
Results:
Docker Images
After this PR, images will be available at:
ghcr.io/techprimate/github-actions-utils-cli:latestdocker.io/techprimate/github-actions-utils-cli:latestBoth support:
linux/amd64linux/arm64Verification
Pull and test the images:
Follow-Up
After merging, optionally remove the
fix-releasebranch trigger fromrelease.ymlif no longer needed for testing.