Skip to content

fix: correct Docker manifest creation in builder image workflow#2588

Merged
Jguer merged 2 commits intonextfrom
jguer/builder-fix
Mar 9, 2025
Merged

fix: correct Docker manifest creation in builder image workflow#2588
Jguer merged 2 commits intonextfrom
jguer/builder-fix

Conversation

@Jguer
Copy link
Copy Markdown
Owner

@Jguer 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
@Jguer Jguer requested a review from Copilot March 9, 2025 19:44
@Jguer Jguer self-assigned this Mar 9, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {}")

Copy link

Copilot AI Mar 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {}")"

Copilot uses AI. Check for mistakes.
@Jguer Jguer merged commit 6705989 into next Mar 9, 2025
6 checks passed
@Jguer Jguer deleted the jguer/builder-fix branch March 9, 2025 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants