Add `-u|--user` flag to docker exec for running command as a different user

Signed-off-by: Lei Jitang <leijitang@huawei.com>
master
Lei Jitang 2015-04-11 11:04:24 +08:00 committed by Tibor Vass
parent a878ece032
commit 3ca275df6d
2 changed files with 2 additions and 1 deletions

View File

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

View File

@ -1121,6 +1121,7 @@ You'll need two shells for this example.
-d, --detach=false Detached mode: run command in the background
-i, --interactive=false Keep STDIN open even if not attached
-t, --tty=false Allocate a pseudo-TTY
-u, --user= Username or UID (format: <name|uid>[:<group|gid>])
The `docker exec` command runs a new command in a running container.