docker-exec - Man Page
Execute a command in a running container
Examples (TL;DR)
- View documentation for the original command:
tldr docker container exec
Synopsis
docker exec [Options] CONTAINER COMMAND [ARG...]
Description
Alias for docker container exec.
Options
-d, --detach[=false] Detached mode: run command in the background
--detach-keys="" Override the key sequence for detaching a container
-e, --env= Set environment variables
--env-file= Read in a file of environment variables
-i, --interactive[=false] Keep STDIN open even if not attached
--privileged[=false] Give extended privileges to the command
-t, --tty[=false] Allocate a pseudo-TTY
-u, --user="" Username or UID (format: "[:]")
-w, --workdir="" Working directory inside the container
See Also
Info
Jan 2026 Docker Community Docker User Manuals