Skip to content

fix(registry): honor credential store when fetching backend images - #1033

Merged
doringeman merged 1 commit into
docker:mainfrom
doringeman:mirror-fetcher-e2e
Aug 6, 2026
Merged

fix(registry): honor credential store when fetching backend images#1033
doringeman merged 1 commit into
docker:mainfrom
doringeman:mirror-fetcher-e2e

Conversation

@doringeman

Copy link
Copy Markdown
Contributor

The backend image fetcher only read inline auths entries from ~/.docker/config.json, so credentials that docker login stores in the OS keychain were invisible and pulls through an authenticated registry mirror failed with a misleading Docker Hub 403. It now resolves credentials through credential helpers and the credential store, scopes DOCKER_HUB_* environment credentials to Hub's own hosts, and adds an inference.RegistryCredentials hook so Docker Desktop can inject in-process credentials instead of shelling out to a helper.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The fake docker-credential helper in TestResolveDigest_AuthenticatedMirror_CredentialStore is implemented as a shell script and skipped on Windows; consider rewriting it in Go so the regression test runs cross-platform and doesn’t depend on /bin/sh being present.
  • defaultCredentials currently hard-codes Docker Hub hostnames in isHubHost; if other Hub endpoints or alternate schemes are introduced, it may be safer to centralize or reuse the host normalization logic already present in the authn package to avoid divergence.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The fake docker-credential helper in TestResolveDigest_AuthenticatedMirror_CredentialStore is implemented as a shell script and skipped on Windows; consider rewriting it in Go so the regression test runs cross-platform and doesn’t depend on /bin/sh being present.
- defaultCredentials currently hard-codes Docker Hub hostnames in isHubHost; if other Hub endpoints or alternate schemes are introduced, it may be safer to centralize or reuse the host normalization logic already present in the authn package to avoid divergence.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Signed-off-by: Dorin Geman <dorin.geman@docker.com>
@doringeman
doringeman merged commit c07af4d into docker:main Aug 6, 2026
8 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