diff --git a/opts/opts.go b/opts/opts.go index 3d8c23ff77..7f40193412 100644 --- a/opts/opts.go +++ b/opts/opts.go @@ -11,6 +11,7 @@ import ( "github.com/docker/docker/api" flag "github.com/docker/docker/pkg/mflag" "github.com/docker/docker/pkg/parsers" + "github.com/docker/docker/utils" ) var ( @@ -168,6 +169,9 @@ func ValidateEnv(val string) (string, error) { if len(arr) > 1 { return val, nil } + if !utils.DoesEnvExist(val) { + return val, nil + } return fmt.Sprintf("%s=%s", val, os.Getenv(val)), nil }