Merge pull request #198 from thaJeztah/add-exec-example

Added usage example for -e for exec
This commit is contained in:
Vincent Demeester 2017-06-15 18:18:48 +02:00 committed by GitHub
commit eb7452cf3a
1 changed files with 11 additions and 0 deletions

View File

@ -76,6 +76,17 @@ $ docker exec -it ubuntu_bash bash
This will create a new Bash session in the container `ubuntu_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 ### Try to run `docker exec` on a paused container
If the container is paused, then the `docker exec` command will fail with an error: If the container is paused, then the `docker exec` command will fail with an error: