fix: correct Docker manifest creation in builder image workflow#2588
Merged
fix: correct Docker manifest creation in builder image workflow#2588
Conversation
Owner
Jguer
commented
Mar 9, 2025
- Fix "invalid reference format" error by properly separating Docker Hub and GitHub Container Registry tags
- Use short SHA format instead of long format for more manageable tags
- Improve manifest list creation process to handle multiple registries correctly
- Ensure proper handling of ghcr.io prefix for GitHub Container Registry
- Fix "invalid reference format" error by properly separating Docker Hub and GitHub Container Registry tags - Use short SHA format instead of long format for more manageable tags - Improve manifest list creation process to handle multiple registries correctly - Ensure proper handling of ghcr.io prefix for GitHub Container Registry
Contributor
There was a problem hiding this comment.
PR Overview
This PR fixes an "invalid reference format" error by correcting Docker manifest creation in the builder image workflow, while also switching to a short SHA format to simplify tag management.
- Update the SHA tag format from long to short.
- Separate Docker Hub and GitHub Container Registry tag extraction.
- Create distinct manifest lists for Docker Hub and GitHub Container Registry.
Reviewed Changes
| File | Description |
|---|---|
| .github/workflows/builder-image.yml | Updated tag extraction logic and manifest list creation to handle tags for two registries |
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
.github/workflows/builder-image.yml:128
- Similarly, ensure that the extraction of GitHub Container Registry tags safely handles tag values with spaces by verifying proper quoting or delimiting.
GHCR_TAGS=$(echo '${{ steps.meta.outputs.tags }}' | grep "^ghcr.io" | xargs -I {} echo "-t {}")
Comment on lines
+125
to
129
| DH_TAGS=$(echo '${{ steps.meta.outputs.tags }}' | grep -v "^ghcr.io" | xargs -I {} echo "-t {}") | ||
|
|
||
| # Extract GitHub Container Registry tags | ||
| GHCR_TAGS=$(echo '${{ steps.meta.outputs.tags }}' | grep "^ghcr.io" | xargs -I {} echo "-t {}") | ||
|
|
There was a problem hiding this comment.
Consider wrapping the command substitution in quotes or otherwise ensuring that whitespace in tag values is handled correctly, to prevent potential splitting issues.
Suggested change
| DH_TAGS=$(echo '${{ steps.meta.outputs.tags }}' | grep -v "^ghcr.io" | xargs -I {} echo "-t {}") | |
| # Extract GitHub Container Registry tags | |
| GHCR_TAGS=$(echo '${{ steps.meta.outputs.tags }}' | grep "^ghcr.io" | xargs -I {} echo "-t {}") | |
| DH_TAGS="$(echo '${{ steps.meta.outputs.tags }}' | grep -v "^ghcr.io" | xargs -I {} echo "-t {}")" | |
| # Extract GitHub Container Registry tags | |
| GHCR_TAGS="$(echo '${{ steps.meta.outputs.tags }}' | grep "^ghcr.io" | xargs -I {} echo "-t {}")" |
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.