From b86a3a9cc0155e290508620238f1d33e29b8070f Mon Sep 17 00:00:00 2001 From: Eli Uriegas Date: Thu, 21 Jun 2018 22:08:20 +0000 Subject: [PATCH] Add env variable option for experimental Signed-off-by: Eli Uriegas --- cli/command/cli.go | 7 ++++++- docs/reference/commandline/cli.md | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cli/command/cli.go b/cli/command/cli.go index 62a36b20b3ad..395252c94e88 100644 --- a/cli/command/cli.go +++ b/cli/command/cli.go @@ -162,7 +162,12 @@ func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions) error { if err != nil { return err } - hasExperimental, err := isEnabled(cli.configFile.Experimental) + experimentalValue := cli.configFile.Experimental + // Environment variable always overrides configuration + if os.Getenv("DOCKER_CLI_EXPERIMENTAL") != "" { + experimentalValue = os.Getenv("DOCKER_CLI_EXPERIMENTAL") + } + hasExperimental, err := isEnabled(experimentalValue) if err != nil { return errors.Wrap(err, "Experimental field") } diff --git a/docs/reference/commandline/cli.md b/docs/reference/commandline/cli.md index ebb9faae2755..4a21aa45f6f4 100644 --- a/docs/reference/commandline/cli.md +++ b/docs/reference/commandline/cli.md @@ -61,6 +61,7 @@ by the `docker` command line: * `DOCKER_API_VERSION` The API version to use (e.g. `1.19`) * `DOCKER_CONFIG` The location of your client configuration files. * `DOCKER_CERT_PATH` The location of your authentication keys. +* `DOCKER_CLI_EXPERIMENTAL` Enable experimental features for the cli (e.g. `enabled` or `disabled`) * `DOCKER_DRIVER` The graph driver to use. * `DOCKER_HOST` Daemon socket to connect to. * `DOCKER_NOWARN_KERNEL_VERSION` Prevent warnings that your Linux kernel is