2024-01-15 07:49:53 -05:00
|
|
|
# docker exec
|
|
|
|
|
|
|
|
<!---MARKER_GEN_START-->
|
|
|
|
Execute a command in a running container
|
|
|
|
|
|
|
|
### Aliases
|
|
|
|
|
|
|
|
`docker container exec`, `docker exec`
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
| Name | Type | Default | Description |
|
|
|
|
|:----------------------|:---------|:--------|:-------------------------------------------------------|
|
2024-07-03 02:29:57 -04:00
|
|
|
| `-d`, `--detach` | `bool` | | Detached mode: run command in the background |
|
2024-01-15 07:49:53 -05:00
|
|
|
| `--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 |
|
2024-07-03 02:29:57 -04:00
|
|
|
| `-i`, `--interactive` | `bool` | | Keep STDIN open even if not attached |
|
|
|
|
| `--privileged` | `bool` | | Give extended privileges to the command |
|
|
|
|
| `-t`, `--tty` | `bool` | | Allocate a pseudo-TTY |
|
2024-01-15 07:49:53 -05:00
|
|
|
| `-u`, `--user` | `string` | | Username or UID (format: `<name\|uid>[:<group\|gid>]`) |
|
|
|
|
| `-w`, `--workdir` | `string` | | Working directory inside the container |
|
|
|
|
|
|
|
|
|
|
|
|
<!---MARKER_GEN_END-->
|
|
|
|
|