docker exec
CautionExec inside container
docker exec -it <c> sh
Runs a command inside a running container; -it sh/bash for a shell.
Examples
docker exec -it db psql -U postgresOpen psql in the DB container
Syntax
docker exec -it <container> <cmd>
Before you run it
Changes inside a container aren't persistent; mind side effects.
Used when you see
Related commands
- docker psList containers
- docker logsContainer logs
The same reference, with no signal at all
Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.
Get it free on the App Store