Docker - ps (List containers)

> Virtualization - (Virtual Machine|Container) > Docker

1 - About

The docker ps command queries the Docker daemon for information about all the containers it knows about.


3 - Syntax

docker ps [OPTIONS]

List containers

  -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

4 - Example

docker ps -a


  • 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