Added usage example for -e for exec

Signed-off-by: Vishnu Narayanan <iamwishnu@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c848d9b22d)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
This commit is contained in:
Sebastiaan van Stijn
2017-07-11 03:50:35 +00:00
committed by Andrew Hsu
parent b0d4910c7e
commit 6a52ac6c49
@@ -76,6 +76,17 @@ $ docker exec -it ubuntu_bash bash
This will create a new Bash session in the container `ubuntu_bash`.
Next, set an environment variable in the current bash session.
```bash
$ docker exec -it -e VAR=1 ubuntu_bash bash
```
This will create a new Bash session in the container `ubuntu_bash` with environment
variable `$VAR` set to "1". Note that this environment variable will only be valid
on the current Bash session.
### Try to run `docker exec` on a paused container
If the container is paused, then the `docker exec` command will fail with an error: