docker container exec <container> <command>

Run a command in a running container

Arguments

NameDescription
container
command

Options

NameDescription
-itLaunch an interactive session
-d, --detachDetached mode: run command in the background
--detach-keys <string>Override the key sequence for detaching a container
-e, --env <list>Set environment variables
--env-file <list>Read in a file of environment variables
-i, --interactiveKeep STDIN open even if not attached
--privilegedGive extended privileges to the command
-t, --ttyAllocate a pseudo-TTY
-u, --user <string>Username or UID (format: <name|uid>[:<group|gid>])
-w, --workdir <string>Working directory inside the container