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 2, 2024
1 parent 1f81225 commit 9fe52e2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/imgutil/dockerconfigresolver/dockerconfigresolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ 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.Host == "index.docker.io" {
regURL.Host = "docker.io"
}
if err != nil {
return "", err
}
Expand Down

0 comments on commit 9fe52e2

Please sign in to comment.