github.com/dpiddy/docker@v1.12.2-rc1/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**] 10 [**--detach-keys**[=*[]*]] 11 [**--help**] 12 [**-i**|**--interactive**] 13 [**--privileged**] 14 [**-t**|**--tty**] 15 [**-u**|**--user**[=*USER*]] 16 CONTAINER COMMAND [ARG...] 17 18 # DESCRIPTION 19 20 Run a process in a running container. 21 22 The command started using `docker exec` will only run while the container's primary 23 process (`PID 1`) is running, and will not be restarted if the container is restarted. 24 25 If the container is paused, then the `docker exec` command will wait until the 26 container is unpaused, and then run 27 28 # OPTIONS 29 **-d**, **--detach**=*true*|*false* 30 Detached mode: run command in the background. The default is *false*. 31 32 **--detach-keys**="" 33 Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. 34 35 **--help** 36 Print usage statement 37 38 **-i**, **--interactive**=*true*|*false* 39 Keep STDIN open even if not attached. The default is *false*. 40 41 **--privileged**=*true*|*false* 42 Give the process extended [Linux capabilities](http://man7.org/linux/man-pages/man7/capabilities.7.html) 43 when running in a container. The default is *false*. 44 45 Without this flag, the process run by `docker exec` in a running container has 46 the same capabilities as the container, which may be limited. Set 47 `--privileged` to give all capabilities to the process. 48 49 **-t**, **--tty**=*true*|*false* 50 Allocate a pseudo-TTY. The default is *false*. 51 52 **-u**, **--user**="" 53 Sets the username or UID used and optionally the groupname or GID for the specified command. 54 55 The followings examples are all valid: 56 --user [user | user:group | uid | uid:gid | user:gid | uid:group ] 57 58 Without this argument the command will be run as root in the container. 59 60 The **-t** option is incompatible with a redirection of the docker client 61 standard input. 62 63 # HISTORY 64 November 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>