From 7d1e197f25d119fd8917d1867cc0284ceea46db4 Mon Sep 17 00:00:00 2001 From: Doug Davis Date: Fri, 10 Oct 2014 15:40:52 -0700 Subject: [PATCH] Add some docs about which env vars are defined in new containers @SvenDowideit FYI Closes #3087 Signed-off-by: Doug Davis --- docs/sources/reference/run.md | 45 ++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/docs/sources/reference/run.md b/docs/sources/reference/run.md index c72d28a000..67007ccff7 100644 --- a/docs/sources/reference/run.md +++ b/docs/sources/reference/run.md @@ -428,9 +428,48 @@ client container to help indicate which interface and port to use. ## ENV (Environment Variables) -The operator can **set any environment variable** in the container by -using one or more `-e` flags, even overriding those already defined by -the developer with a Dockerfile `ENV`: +When a new container is created, Docker will set the following environment +variables automatically: + + + + + + + + + + + + + + + + + + + + + +
Variable Value
HOME + Set based on the value of USER +
HOSTNAME + The hostname associated with the container +
PATH + Includes popular directories, such as :
+ /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +
TERM + xterm if the container is allocated a psuedo-TTY +
+ +The container may also include environment variables defined +as a result of the container being linked with another container. See +the [*Container Links*](/userguide/dockerlinks/#container-linking) +section for more details. + +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`: $ sudo docker run -e "deep=purple" --rm ubuntu /bin/bash -c export declare -x HOME="/"