From 8615c08e7c52472907aae8a438e43eb096eb174a Mon Sep 17 00:00:00 2001 From: "shuwen.wu" Date: Sat, 26 Sep 2026 00:43:33 +0800 Subject: [PATCH] Fix logout canonicalization for docker.io When running 'docker logout docker.io', the CLI was not canonicalizing the server address to 'https://index.docker.io/v1/' like 'docker login' does, which meant credentials were not removed. This change makes logout use the same canonicalization logic as login. Closes #7326 Signed-off-by: shuwen.wu --- cli/command/registry/logout.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/command/registry/logout.go b/cli/command/registry/logout.go index 16218f67d9a7..436376fdf313 100644 --- a/cli/command/registry/logout.go +++ b/cli/command/registry/logout.go @@ -46,7 +46,9 @@ func runLogout(ctx context.Context, dockerCLI command.Cli, serverAddress string) var isDefaultRegistry bool - if serverAddress == "" { + if serverAddress != "" && serverAddress != registry.DefaultNamespace { + isDefaultRegistry = false + } else { serverAddress = registry.IndexServer isDefaultRegistry = true }