docker-exec(1)

docker-exec1

Execute a command in a running container

Usage

docker exec [OPTIONS] CONTAINER COMMAND [ARG ...]

Overview

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

Releases

5 releases since Debian 10 (Buster); the text changed 4 times.

  1. 10
  2. 11
  3. 12
  4. 13
  5. Arch

From docker 1:29.9.2-1 in Arch Linux 2026-11-01. Also shipped by podman-docker. Parsed by carta from the page's man source.