diff --git a/cli/command/registry/login.go b/cli/command/registry/login.go index 03303eb6dd2f..1a6c28bfaf20 100644 --- a/cli/command/registry/login.go +++ b/cli/command/registry/login.go @@ -88,7 +88,9 @@ func runLogin(ctx context.Context, dockerCli command.Cli, opts loginOptions) err serverAddress string response *registrytypes.AuthenticateOKBody ) - if opts.serverAddress != "" && opts.serverAddress != registry.DefaultNamespace { + if opts.serverAddress != "" && + opts.serverAddress != registry.DefaultNamespace && + opts.serverAddress != registry.DefaultRegistryHost { serverAddress = opts.serverAddress } else { serverAddress = registry.IndexServer