A container is not simply on or off. It moves through a small set of states over its life, and knowing which state a container is in tells you what you can do with it.
docker create (a rarely used cousin of run), or briefly
before a container starts.docker ps
shows.docker pause and can be resumed with docker unpause. Used rarely.Most containers walk a simple line: created, then running, then exited.
A one-shot command like docker run alpine echo hi blinks through
running and lands in exited almost instantly. A service like nginx
sits in running until you stop it, then moves to exited.
The STATUS column in docker ps -a spells the state out with detail:
Up 3 minutes
Exited (0) 10 seconds ago
Exited (137) 2 minutes ago
"Up" means running. "Exited (0)" means it stopped and the process returned exit code 0, a clean finish. "Exited (137)" means it stopped with a non-zero code, which usually signals a problem - the next node is about exactly that.
docker pause CONTAINER / docker unpause CONTAINER - freeze and
resume a container