diff --git a/cli/cmd/docker.go b/cli/cmd/docker.go index c91d3fced5..fcd692b634 100644 --- a/cli/cmd/docker.go +++ b/cli/cmd/docker.go @@ -138,6 +138,10 @@ func dockerConfig(user *api.AuthCheckResponse, client *api.Client, args []string configFile.CredentialHelpers = make(map[string]string) } + if configFile.AuthConfigs == nil { + configFile.AuthConfigs = make(map[string]types.AuthConfig) + } + for _, regURL := range regToAdd { // if this is a dockerhub registry, see if an auth config has already been generated // for index.docker.io