Merge pull request #3372 from knocte/patch-1

docker exec cli docs: show 2 env vars, not just 1
This commit is contained in:
Sebastiaan van Stijn 2021-12-09 12:28:07 +01:00 committed by GitHub
commit 548fd20087
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -69,15 +69,15 @@ $ 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. Next, set environment variables in the current bash session.
```console ```console
$ docker exec -it -e VAR=1 ubuntu_bash bash $ docker exec -it -e VAR_A=1 -e VAR_B=2 ubuntu_bash bash
``` ```
This will create a new Bash session in the container `ubuntu_bash` with environment 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 variables `$VAR_A` and `$VAR_B` set to "1" and "2" respectively. Note that these
on the current Bash session. environment variables will only be valid on the current Bash session.
By default `docker exec` command runs in the same working directory set when container was created. By default `docker exec` command runs in the same working directory set when container was created.