List running and stopped containers
Read-only
What do risk levels mean?
- Read-only
- Inspects state without changing anything.
- Low risk
- Reversible with a routine follow-up command.
- Medium risk
- Changes state; undo path documented.
- Destructive
- Deletes or overwrites; confirmation required.
Shows every container on the local Docker host, including stopped ones, so you can see what is running, what exited, and which ports are published.
dockercontainersinspect
Commands
List currently running containers with their ports and uptime
docker psInclude stopped containers and show each container's disk usage
docker ps --all --sizeVerification
docker ps --allEvery container appears with a status such as Up or Exited; an empty list means no containers exist.
Undo
Not undoable
This recipe only reads container state and changes nothing.
Pitfalls
- The --size column reports the writable layer only, not image or volume usage.
- If the daemon is not running the command fails with a connection error; start Docker first.