Skip to content

Commit d3aea72

Browse files
committed
Set auth only for docker images
Signed-off-by: David Gageot <[email protected]>
1 parent 97d56eb commit d3aea72

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cmd/docker-mcp/internal/docker/images.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"io"
77
"runtime"
8+
"strings"
89
"sync"
910

1011
cerrdefs "github.com/containerd/errdefs"
@@ -69,8 +70,9 @@ func (c *dockerClient) pullImage(ctx context.Context, imageName string, registry
6970
}
7071
}
7172

72-
pullOptions := image.PullOptions{
73-
RegistryAuth: registryAuthFn(),
73+
var pullOptions image.PullOptions
74+
if strings.HasPrefix(ref.Name(), "docker.io/") {
75+
pullOptions.RegistryAuth = registryAuthFn()
7476
}
7577

7678
response, err := c.apiClient().ImagePull(ctx, imageName, pullOptions)

0 commit comments

Comments
 (0)