O'Reilly logo

Docker and Kubernetes for Java Developers by Jaroslaw Krochmalski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Listing the running containers

To list the running containers, simply execute the docker ps command:

$ docker ps  

To include all containers present on your Docker host, include the -a option:

$ docker ps -a  

You can also filter the list using -f option to specify a filter. The filter needs to be provided as a key=value format. Currently available filters include:

  • id: Filters by the container's id
  • label: Filters by label
  • name: Filters by the container's name
  • exited: Filters by the container's exit code
  • status: Filters by status, which can be created, restarting, running, removing, paused, exited or dead
  • volume: When specified with volume name or mount point will include containers that mount specified volumes
  • network: When specified with ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required