docker stop
Stop one or more running containers. Sends SIGTERM first, then SIGKILL after timeout.
Syntax
docker stop [OPTIONS] CONTAINER [CONTAINER...]
Examples
Example 1
docker stop my-container
Gracefully stop a single container.
Example 2
docker stop -t 5 my-container
Wait 5 seconds before SIGKILL.
Example 3
docker stop $(docker ps -q)
Stop all running containers.
Common flags
| Flag | Description |
|---|---|
| -t, --time | Seconds to wait before killing (default 10) |
Tips & best practices
- •stop sends SIGTERM; use docker kill for immediate SIGKILL.
- •Containers can be restarted with docker start.