github.com/guilhermebr/docker@v1.4.2-0.20150428121140-67da055cebca/docs/man/docker-exec.1.md (about) 1 % DOCKER(1) Docker User Manuals 2 % Docker Community 3 % JUNE 2014 4 # NAME 5 docker-exec - Run a command in a running container 6 7 # SYNOPSIS 8 **docker exec** 9 [**-d**|**--detach**[=*false*]] 10 [**--help**] 11 [**-i**|**--interactive**[=*false*]] 12 [**--privileged**[=*false*]] 13 [**-t**|**--tty**[=*false*]] 14 [**-u**|**--user**[=*USER*]] 15 CONTAINER COMMAND [ARG...] 16 17 # DESCRIPTION 18 19 Run a process in a running container. 20 21 The command started using `docker exec` will only run while the container's primary 22 process (`PID 1`) is running, and will not be restarted if the container is restarted. 23 24 If the container is paused, then the `docker exec` command will wait until the 25 container is unpaused, and then run 26 27 # OPTIONS 28 **-d**, **--detach**=*true*|*false* 29 Detached mode: run command in the background. The default is *false*. 30 31 **--help** 32 Print usage statement 33 34 **-i**, **--interactive**=*true*|*false* 35 Keep STDIN open even if not attached. The default is *false*. 36 37 **--privileged**=*true*|*false* 38 Give extended privileges to the process to run in a running container. The default is *false*. 39 40 By default, the process run by docker exec in a running container 41 have the same capabilities of the container. By setting --privileged will give 42 all the capabilities to the process. 43 44 **-t**, **--tty**=*true*|*false* 45 Allocate a pseudo-TTY. The default is *false*. 46 47 **-u**, **--user**="" 48 Sets the username or UID used and optionally the groupname or GID for the specified command. 49 50 The followings examples are all valid: 51 --user [user | user:group | uid | uid:gid | user:gid | uid:group ] 52 53 Without this argument the command will be run as root in the container. 54 55 The **-t** option is incompatible with a redirection of the docker client 56 standard input. 57 58 # HISTORY 59 November 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>