From 0e32baf1153ed299d2387a5ccbd3308bba15f4f3 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 26 Mar 2025 14:43:57 +0100 Subject: [PATCH] cli/command: fix regression in resolving auth from config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was introduced in 79141ce5eb8f7c341b03aa50f7ce4b819de20720, which was reverted in f5962021251c127326d654a440c8b6b675e2ba0d, and re-applied in the previous commit. Before this patch, saving credentials worked correctly; docker login -u thajeztah Password: Login Succeeded cat ~/.docker/config.json { "auths": { "https://index.docker.io/v1/": { "auth": "REDACTED" } } } But when resolving the credentials, the credentials stored would not be found; docker pull -q thajeztah/private-test-image Error response from daemon: pull access denied for thajeztah/private-test-image, repository does not exist or may require 'docker login': denied: requested access to the resource is denied With this patch applied: docker pull -q thajeztah/private-test-image docker.io/thajeztah/private-test-image:latest Thanks to mtrmac (Miloslav Trmač) for spotting this mistake! Suggested-by: Miloslav Trmač Signed-off-by: Sebastiaan van Stijn --- cli/command/registry.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/command/registry.go b/cli/command/registry.go index cf7243aabe..acf0c7e635 100644 --- a/cli/command/registry.go +++ b/cli/command/registry.go @@ -31,7 +31,7 @@ const ( // a copy of [registry.IndexServer]. // // [registry.IndexServer]: https://pkg.go.dev/github.com/docker/docker/registry#IndexServer -const authConfigKey = "https:/index.docker.io/v1/" +const authConfigKey = "https://index.docker.io/v1/" // RegistryAuthenticationPrivilegedFunc returns a RequestPrivilegeFunc from the specified registry index info // for the given command.