Skip to content

Commit 00cbc7d

Browse files
fix: docker auth for docker.io images
1 parent 8528d77 commit 00cbc7d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docker_auth.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"fmt"
1111
"net/url"
1212
"os"
13+
"strings"
1314
"sync"
1415

1516
"github.com/cpuguy83/dockercfg"
@@ -42,6 +43,11 @@ func dockerImageAuth(ctx context.Context, image string, configs map[string]regis
4243
defaultRegistry := defaultRegistryFn(ctx)
4344
reg := core.ExtractRegistry(image, defaultRegistry)
4445

46+
// Make comparison case-insensitive and handle both aliases
47+
if strings.EqualFold(reg, "docker.io") || strings.EqualFold(reg, "registry.hub.docker.com") {
48+
reg = defaultRegistry
49+
}
50+
4551
if cfg, ok := getRegistryAuth(reg, configs); ok {
4652
return reg, cfg, nil
4753
}

0 commit comments

Comments
 (0)