Fix image pull auth for non-Docker Hub registries#458
Conversation
Docker Desktop mirrors Hub credentials to dhi.io on login (pinata b497446ff36), but the gateway only passed registry auth for docker.io images. This caused 401 errors when pulling dhi.io images even though valid credentials existed in the credential store. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The gateway only passed registry auth for docker.io images, causing 401 errors when pulling from other registries (e.g. dhi.io) even when valid credentials existed in the Docker credential store. For non-docker.io registries, resolve credentials from the standard Docker CLI credential store (ConfigFile().GetAuthConfig), which works with any credential helper (osxkeychain, secretservice, etc.) and does not require Docker Desktop. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ab9e1d5 to
47b54b9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 47b54b9f81
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Replace hand-rolled credential encoding with command.RetrieveAuthTokenFromImage which correctly handles IdentityToken auth, base64url encoding, and hostname normalization — the same auth path docker pull uses natively. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
51048ed to
2fddfaf
Compare
|
question: this experience have something to do with these changes? Seems odd because it appear to work fine for dhi, but I get some kind of auth related issue for the docker mcp catalog? |
Hmm, this change shouldn't impact the existing docker.io path at all since we just branch off. Given that pulling |


Summary
RegistryAuthfordocker.io/prefixed images, causing401 Unauthorizederrors when pulling from other registries (e.g.dhi.iofor Docker Hardened Images of MCP servers) even when valid credentials existed in the Docker credential storecommand.RetrieveAuthTokenFromImageto resolve credentials from the credential store — the same auth path thatdocker pulluses natively/registry/tokenpathosxkeychain,secretservice, etc.)Test plan
docker mcp catalog pull docker/mcp-catalog-dhithendocker mcp gateway run— dhi.io images should pull without 401 errors🤖 Generated with Claude Code