About
The docker ps command queries the Docker daemon for information about all the containers it knows about.
Articles Related
Syntax
docker ps [OPTIONS]
List containers
Options:
-a, --all Show all containers (default shows just running)
-f, --filter value Filter output based on conditions provided (default [])
--format string Pretty-print containers using a Go template
--help Print usage
-n, --last int Show n last created containers (includes all states) (default -1)
-l, --latest Show the latest created container (includes all states)
--no-trunc Don't truncate output
-q, --quiet Only display numeric IDs
-s, --size Display total file sizes
Example
docker ps -a
where:
- a let you see stopped container
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3e3a1ac2c76e ubuntu "/bin/sh -c 'while tr" 39 seconds ago Up 39 seconds jolly_panini
where:
- 3e3a1ac2c76e is the container id
- unbutu is the image.
- jolly_panini is the container assigned name