diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index aba5331b6e..588b9e1d37 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -1277,7 +1277,7 @@ _docker_exec() { case "$cur" in -*) - COMPREPLY=( $( compgen -W "--detach -d --detach-keys --help --interactive -i --privileged -t --tty -u --user" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "--detach -d --detach-keys -e --env --help --interactive -i --privileged -t --tty -u --user" -- "$cur" ) ) ;; *) __docker_complete_containers_running diff --git a/contrib/completion/zsh/_docker b/contrib/completion/zsh/_docker index 2cefa33e50..e06082721f 100644 --- a/contrib/completion/zsh/_docker +++ b/contrib/completion/zsh/_docker @@ -1679,6 +1679,7 @@ __docker_subcommand() { $opts_help \ $opts_attach_exec_run_start \ "($help -d --detach)"{-d,--detach}"[Detached mode: leave the container running in the background]" \ + "($help -e --env)"{-e,--env}"[Set environment variables]" \ "($help -i --interactive)"{-i,--interactive}"[Keep stdin open even if not attached]" \ "($help)--privileged[Give extended Linux capabilities to the command]" \ "($help -t --tty)"{-t,--tty}"[Allocate a pseudo-tty]" \ diff --git a/docs/reference/commandline/exec.md b/docs/reference/commandline/exec.md index 9be6cbadd8..c6b7314dc7 100644 --- a/docs/reference/commandline/exec.md +++ b/docs/reference/commandline/exec.md @@ -14,6 +14,7 @@ Run a command in a running container Options: -d, --detach Detached mode: run command in the background --detach-keys Override the key sequence for detaching a container + -e, --env=[] Set environment variables --help Print usage -i, --interactive Keep STDIN open even if not attached --privileged Give extended privileges to the command diff --git a/man/docker-exec.1.md b/man/docker-exec.1.md index 16a061d069..fe9c279e7e 100644 --- a/man/docker-exec.1.md +++ b/man/docker-exec.1.md @@ -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-` where `` 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