Add `-u|--user` flag to docker exec for running command as a different user
Signed-off-by: Lei Jitang <leijitang@huawei.com>master
parent
a878ece032
commit
3ca275df6d
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
Loading…
Reference in New Issue