mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #32939 from jvmatl/master
Improve documentation on the -e flag to the 'run' cli command.
This commit is contained in:
commit
85a7f4bbc7
1 changed files with 6 additions and 2 deletions
|
|
@ -1408,13 +1408,17 @@ The following environment variables are set for Linux containers:
|
||||||
|
|
||||||
Additionally, the operator can **set any environment variable** in the
|
Additionally, the operator can **set any environment variable** in the
|
||||||
container by using one or more `-e` flags, even overriding those mentioned
|
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
|
```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
|
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
HOSTNAME=d2219b854598
|
HOSTNAME=d2219b854598
|
||||||
deep=purple
|
deep=purple
|
||||||
|
today=Wednesday
|
||||||
HOME=/root
|
HOME=/root
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue