github.com/docker/docker-ce@v17.12.1-ce-rc2+incompatible/components/cli/man/src/container/exec.md (about) 1 Run a process in a running container. 2 3 The command started using `docker exec` will only run while the container's primary 4 process (`PID 1`) is running, and will not be restarted if the container is restarted. 5 6 If the container is paused, then the `docker exec` command will wait until the 7 container is unpaused, and then run 8 9 # CAPABILITIES 10 11 `privileged` gives the process extended 12 [Linux capabilities](http://man7.org/linux/man-pages/man7/capabilities.7.html) 13 when running in a container. 14 15 Without this flag, the process run by `docker exec` in a running container has 16 the same capabilities as the container, which may be limited. Set 17 `--privileged` to give all capabilities to the process. 18 19 # USER 20 `user` sets the username or UID used and optionally the groupname or GID for the specified command. 21 22 The followings examples are all valid: 23 --user [user | user:group | uid | uid:gid | user:gid | uid:group ] 24 25 Without this argument the command will be run as root in the container.