|
7 | 7 |
|
8 | 8 | "github.com/docker/cli/cli/config" |
9 | 9 | "github.com/docker/cli/opts" |
| 10 | + "github.com/docker/docker/client" |
10 | 11 | "github.com/docker/go-connections/tlsconfig" |
11 | 12 | "github.com/sirupsen/logrus" |
12 | 13 | "github.com/spf13/pflag" |
@@ -36,9 +37,10 @@ Refer to https://docs.docker.com/go/formatting/ for more information about forma |
36 | 37 | ) |
37 | 38 |
|
38 | 39 | var ( |
39 | | - dockerCertPath = os.Getenv("DOCKER_CERT_PATH") |
40 | | - dockerTLSVerify = os.Getenv("DOCKER_TLS_VERIFY") != "" |
41 | | - dockerTLS = os.Getenv("DOCKER_TLS") != "" |
| 40 | + dockerCertPath = os.Getenv(client.EnvOverrideCertPath) |
| 41 | + dockerTLSVerify = os.Getenv(client.EnvTLSVerify) != "" |
| 42 | + // TODO(thaJeztah) the 'DOCKER_TLS' environment variable is not documented, and does not have a const. |
| 43 | + dockerTLS = os.Getenv("DOCKER_TLS") != "" |
42 | 44 | ) |
43 | 45 |
|
44 | 46 | // CommonOptions are options common to both the client and the daemon. |
@@ -84,7 +86,7 @@ func (commonOpts *CommonOptions) InstallFlags(flags *pflag.FlagSet) { |
84 | 86 | hostOpt := opts.NewNamedListOptsRef("hosts", &commonOpts.Hosts, nil) |
85 | 87 | flags.VarP(hostOpt, "host", "H", "Daemon socket(s) to connect to") |
86 | 88 | flags.StringVarP(&commonOpts.Context, "context", "c", "", |
87 | | - `Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with "docker context use")`) |
| 89 | + `Name of the context to use to connect to the daemon (overrides `+client.EnvOverrideHost+` env var and default context set with "docker context use")`) |
88 | 90 | } |
89 | 91 |
|
90 | 92 | // SetDefaultOptions sets default values for options after flag parsing is |
|
0 commit comments