docker exec

Execute a command in a running container

Aliases

docker container exec, docker exec

Options

NameTypeDefaultDescription
-d, --detachboolDetached mode: run command in the background
--detach-keysstringOverride the key sequence for detaching a container
-e, --envlistSet environment variables
--env-filelistRead in a file of environment variables
-i, --interactiveboolKeep STDIN open even if not attached
--privilegedboolGive extended privileges to the command
-t, --ttyboolAllocate a pseudo-TTY
-u, --userstringUsername or UID (format: <name|uid>[:<group|gid>])
-w, --workdirstringWorking directory inside the container