docker exec¶
Description¶
Runs a command inside a running container, often used to open a shell for debugging.
Syntax¶
Common Options¶
| Option | Description |
|---|---|
-it |
Interactive session with a terminal |
-e KEY=VALUE |
Set an environment variable for the command |
-w PATH |
Set the working directory |
-u USER |
Run as a specific user |
Examples¶
Only works on a running container.