Skip to content

Fix registry-port references in FROM and children - #130

Merged
tianon merged 1 commit into
docker-library:masterfrom
agammann:fix/registry-port-image-references
Oct 21, 2026
Merged

tianon merged 1 commit into
docker-library:masterfrom
agammann:fix/registry-port-image-references

Conversation

@agammann

Copy link
Copy Markdown
Contributor

Summary

  • Treat the colon in a registry host port separately from an image tag when adding an implicit :latest to Dockerfile parents.
  • Resolve bashbrew children repository arguments that include a registry port or digest.

Reproduction

With FROM registry.example:5000/team/base, bashbrew from example previously printed the untagged reference and bashbrew children registry.example:5000/team/base failed to resolve the repository. The commands now use registry.example:5000/team/base:latest and identify the dependent image.

Verification

  • go test -race ./... (Linux, Go 1.24.0)
  • go vet ./pkg/dockerfile ./cmd/bashbrew (Linux, Go 1.24.0)
  • Local manifest and Git fixture exercised both CLI commands before and after the fix.
  • git diff --check

@tianon tianon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice, this seems solid/correct to me! Good catch!

I'm curious though, what's your use case? (This doesn't affect any of our builds or processes right now, as evidenced by it being an issue for years. 😂)

@agammann

Copy link
Copy Markdown
Contributor Author

Thanks! This came from testing port-qualified registry references; I don't have an affected docker-library build to point to.

The case is an untagged base such as FROM registry.example:5000/team/base: bashbrew from leaves it untagged instead of adding :latest, and bashbrew children registry.example:5000/team/base misses the dependent image because it treats the host-port colon as a tag separator. That's the use case covered by the command-level reproductions and regression tests in this PR.

@tianon

tianon commented Oct 21, 2026

Copy link
Copy Markdown
Member

Yeah fair, thanks for sharing -- merging because it's correct (even though it doesn't affect us). 👍

I can't make any regression promises here, but hopefully the tests do well enough (they're the strongest evidence of correctness here ❤️)

@tianon
tianon merged commit 24417a4 into docker-library:master Oct 21, 2026
7 checks passed
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