Exec: Add ability to set environment variables

Keeping the current behavior for exec, i.e., inheriting
variables from main process. New variables will be added
to current ones. If there's already a variable with that
name it will be overwritten.

Example of usage: docker exec -it -e TERM=vt100 <container> top

Closes #24355.

Signed-off-by: Jonh Wendell <jonh.wendell@redhat.com>
This commit is contained in:
Jonh Wendell
2017-06-02 00:10:25 +00:00
committed by Tibor Vass
parent 38d93769fe
commit 73dd34b2b3
4 changed files with 10 additions and 1 deletions
+7
View File
@@ -8,6 +8,7 @@ docker-exec - Run a command in a running container
**docker exec**
[**-d**|**--detach**]
[**--detach-keys**[=*[]*]]
[**-e**|**--env**[=*[]*]]
[**--help**]
[**-i**|**--interactive**]
[**--privileged**]
@@ -32,6 +33,12 @@ container is unpaused, and then run
**--detach-keys**=""
Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`.
**-e**, **--env**=[]
Set environment variables
This option allows you to specify arbitrary environment variables that are
available for the command to be executed.
**--help**
Print usage statement