container status
The current state of a container as Docker reports it, such as created, running, exited or restarting.
In more detail
docker ps shows it as Up 5 minutes, Exited (0) 2 seconds ago and so on; the number in brackets is the exit code. docker inspect -f "{{.State.Status}}" gives the bare word. A health check adds healthy or unhealthy.
Related terms
- container lifecycle — The stages a container passes through: created, running, paused, stopped (exited) and removed.
- exit code — A number a process returns when it finishes: 0 means success, anything else means something went wrong.
- health check — A regular automated test of whether a program or service is working, such as a request to its health endpoint or a command run inside its container.
- docker ps — Lists running containers; add -a to include stopped ones.
Taught in
- Run, Stop, Restart And Remove A Container — Docker Architecture & Production Containers
- Commands, Logs, Exec And Exit Codes — Docker Architecture & Production Containers