mirror of https://github.com/docker/cli.git
Docker run -e FOO should erase FOO if FOO isn't set in client env
See #10141 for more info, but the main point of this is to make sure that if you do "docker run -e FOO ..." that FOO from the current env is passed into the container. This means that if there's a value, its set. But it also means that if FOO isn't set then it should be unset in the container too - even if it has to remove it from the env. So, unset HOSTNAME docker run -e HOSTNAME busybox env should _NOT_ show HOSTNAME in the list at all Closes #10141 Signed-off-by: Doug Davis <dug@us.ibm.com>
This commit is contained in:
parent
3296ada2ed
commit
642218cefa
|
@ -1736,9 +1736,12 @@ ports in Docker.
|
||||||
|
|
||||||
This sets environmental variables in the container. For illustration all three
|
This sets environmental variables in the container. For illustration all three
|
||||||
flags are shown here. Where `-e`, `--env` take an environment variable and
|
flags are shown here. Where `-e`, `--env` take an environment variable and
|
||||||
value, or if no "=" is provided, then that variable's current value is passed
|
value, or if no `=` is provided, then that variable's current value is passed
|
||||||
through (i.e. `$MYVAR1` from the host is set to `$MYVAR1` in the container). All
|
through (i.e. `$MYVAR1` from the host is set to `$MYVAR1` in the container).
|
||||||
three flags, `-e`, `--env` and `--env-file` can be repeated.
|
When no `=` is provided and that variable is not defined in the client's
|
||||||
|
environment then that variable will be removed from the container's list of
|
||||||
|
environment variables.
|
||||||
|
All three flags, `-e`, `--env` and `--env-file` can be repeated.
|
||||||
|
|
||||||
Regardless of the order of these three flags, the `--env-file` are processed
|
Regardless of the order of these three flags, the `--env-file` are processed
|
||||||
first, and then `-e`, `--env` flags. This way, the `-e` or `--env` will
|
first, and then `-e`, `--env` flags. This way, the `-e` or `--env` will
|
||||||
|
|
Loading…
Reference in New Issue