From a316bc3895b65a70fcca4a6c3c1ea9c152d5dbcb Mon Sep 17 00:00:00 2001 From: "John V. Martinez" Date: Mon, 1 May 2017 02:08:03 -0400 Subject: [PATCH] Improve documentation on the -e flag to the 'run' cli command. The ability to import the current vale of an environment variable by simply naming the variable didn't seem to be documented anywhere. (see opts/env.go) Signed-off-by: John V. Martinez --- docs/reference/run.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/reference/run.md b/docs/reference/run.md index 532acebad5..b209343b58 100644 --- a/docs/reference/run.md +++ b/docs/reference/run.md @@ -1408,13 +1408,17 @@ The following environment variables are set for Linux containers: Additionally, the operator can **set any environment variable** in the container by using one or more `-e` flags, even overriding those mentioned -above, or already defined by the developer with a Dockerfile `ENV`: +above, or already defined by the developer with a Dockerfile `ENV`. If the +operator names an environment variable without specifying a value, then the +current value of the named variable is propagated into the container's environment: ```bash -$ docker run -e "deep=purple" --rm alpine env +$ export today=Wednesday +$ docker run -e "deep=purple" -e today --rm alpine env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOSTNAME=d2219b854598 deep=purple +today=Wednesday HOME=/root ```