diff --git a/cli/command/cli.go b/cli/command/cli.go index 4949835f9489..7eb03ac8e698 100644 --- a/cli/command/cli.go +++ b/cli/command/cli.go @@ -459,7 +459,7 @@ func resolveContextName(opts *cliflags.CommonOptions, config *configfile.ConfigF if os.Getenv(client.EnvOverrideHost) != "" { return DefaultContextName, nil } - if ctxName, ok := os.LookupEnv("DOCKER_CONTEXT"); ok { + if ctxName := os.Getenv("DOCKER_CONTEXT"); ctxName != "" { return ctxName, nil } if config != nil && config.CurrentContext != "" {