Revert "Revert "Add docker exec run a command in privileged mode""

This reverts commit 40b71adee390e9c06471b89ed845132b4ec80177.

Original commit (for which this is effectively a rebased version) is
72a500e9e5929b038816d8bd18d462a19e571c99 and was provided by Lei Jitang
<leijitang@huawei.com>.

Signed-off-by: Tim Dettrick <t.dettrick@uq.edu.au>
This commit is contained in:
Tim Dettrick 2015-06-19 16:01:50 +10:00 committed by Tibor Vass
parent 47f2d2bc86
commit d0fa83e285
3 changed files with 10 additions and 1 deletions

View File

@ -675,7 +675,7 @@ _docker_exec() {
case "$cur" in case "$cur" in
-*) -*)
COMPREPLY=( $( compgen -W "--detach -d --help --interactive -i -t --tty -u --user" -- "$cur" ) ) COMPREPLY=( $( compgen -W "--detach -d --help --interactive -i --privileged -t --tty -u --user" -- "$cur" ) )
;; ;;
*) *)
__docker_containers_running __docker_containers_running

View File

@ -17,6 +17,7 @@ weight=1
-d, --detach=false Detached mode: run command in the background -d, --detach=false Detached mode: run command in the background
-i, --interactive=false Keep STDIN open even if not attached -i, --interactive=false Keep STDIN open even if not attached
--privileged=false Give extended privileges to the command
-t, --tty=false Allocate a pseudo-TTY -t, --tty=false Allocate a pseudo-TTY
-u, --user= Username or UID (format: <name|uid>[:<group|gid>]) -u, --user= Username or UID (format: <name|uid>[:<group|gid>])

View File

@ -9,6 +9,7 @@ docker-exec - Run a command in a running container
[**-d**|**--detach**[=*false*]] [**-d**|**--detach**[=*false*]]
[**--help**] [**--help**]
[**-i**|**--interactive**[=*false*]] [**-i**|**--interactive**[=*false*]]
[**--privileged**[=*false*]]
[**-t**|**--tty**[=*false*]] [**-t**|**--tty**[=*false*]]
[**-u**|**--user**[=*USER*]] [**-u**|**--user**[=*USER*]]
CONTAINER COMMAND [ARG...] CONTAINER COMMAND [ARG...]
@ -33,6 +34,13 @@ container is unpaused, and then run
**-i**, **--interactive**=*true*|*false* **-i**, **--interactive**=*true*|*false*
Keep STDIN open even if not attached. The default is *false*. Keep STDIN open even if not attached. The default is *false*.
**--privileged**=*true*|*false*
Give extended privileges to the process to run in a running container. The default is *false*.
By default, the process run by docker exec in a running container
have the same capabilities of the container. By setting --privileged will give
all the capabilities to the process.
**-t**, **--tty**=*true*|*false* **-t**, **--tty**=*true*|*false*
Allocate a pseudo-TTY. The default is *false*. Allocate a pseudo-TTY. The default is *false*.