Skip to content

Commit

Permalink
Fix hosts.toml resolution for docker domain
Browse files Browse the repository at this point in the history
Signed-off-by: apostasie <[email protected]>
  • Loading branch information
apostasie committed Dec 3, 2024
1 parent 1f81225 commit e2708fb
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 e2708fb

Please sign in to comment.