Skip to content

Commit

Permalink
Merge pull request #3720 from apostasie/fix-3697
Browse files Browse the repository at this point in the history
Fix hosts.toml resolution for docker domain
  • Loading branch information
AkihiroSuda authored Dec 3, 2024
2 parents 6537124 + e2708fb commit 051b047
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/imgutil/dockerconfigresolver/dockerconfigresolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ func NewHostOptions(ctx context.Context, refHostname string, optFuncs ...Opt) (*

ho.HostDir = func(hostURL string) (string, error) {
regURL, err := Parse(hostURL)
// Docker inconsistencies handling: `index.docker.io` actually expects `docker.io` for hosts.toml on the filesystem
// See https://github.com/containerd/nerdctl/issues/3697
// FIXME: we need to reevaluate this comparing with what docker does. What should happen for FQ images with alternate docker domains? (eg: registry-1.docker.io)
if regURL.Hostname() == "index.docker.io" {
regURL.Host = "docker.io"
}

if err != nil {
return "", err
}
Expand Down

0 comments on commit 051b047

Please sign in to comment.