github.com/panekj/cli@v0.0.0-20230304125325-467dd2f3797e/docs/reference/commandline/container_exec.md (about) 1 # container exec 2 3 <!---MARKER_GEN_START--> 4 Execute a command in a running container 5 6 ### Aliases 7 8 `docker container exec`, `docker exec` 9 10 ### Options 11 12 | Name | Type | Default | Description | 13 |:----------------------|:---------|:--------|:-------------------------------------------------------| 14 | `-d`, `--detach` | | | Detached mode: run command in the background | 15 | `--detach-keys` | `string` | | Override the key sequence for detaching a container | 16 | `-e`, `--env` | `list` | | Set environment variables | 17 | `--env-file` | `list` | | Read in a file of environment variables | 18 | `-i`, `--interactive` | | | Keep STDIN open even if not attached | 19 | `--privileged` | | | Give extended privileges to the command | 20 | `-t`, `--tty` | | | Allocate a pseudo-TTY | 21 | `-u`, `--user` | `string` | | Username or UID (format: `<name\|uid>[:<group\|gid>]`) | 22 | `-w`, `--workdir` | `string` | | Working directory inside the container | 23 24 25 <!---MARKER_GEN_END--> 26 27 ## Description 28 29 See [docker exec](exec.md) for more information.