liveBook · Manning

Docker ps

As explained in Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform

docker ps is a Docker command that lists containers on the Docker host.

docker ps lists all containers on the Docker host, making it useful for checking what is currently running while another terminal remains occupied by Docker Compose. section 4.3.4

Use docker ps to:

  • Check whether a container is still running after starting or removing it. section 3.9.3
  • Inspect the host-wide container list, including containers created outside the current Docker Compose project. section 4.3.4
  • Compare the host-wide result with docker compose ps, which is limited to services declared in the current Compose file. section 4.3.4

Check a container after removal

After stopping and removing a container with docker stop <your-container-id> and docker rm <your-container-id>, run docker ps again to verify that it no longer appears among running containers. section 3.9.3

docker compose ps

Use docker compose ps alongside docker ps to distinguish project-scoped containers from every container on the development computer. section 4.3.4

How Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform covers it

How deep it goes
Defines host-wide listing and contrasts it with Docker Compose scoping, but does not detail filtering or output columns.
Examples
Uses running-container inspection and post-removal verification in a video-streaming microservice workflow.
What it assumes
Assumes a Docker development computer and introduces the distinction between host-wide and Compose-scoped container listings.
What you can do after
Diagnose which containers are running and verify that a removed container no longer appears.
How it connects
Connects Docker containers with Docker Compose, container images, and container registries.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform. The section links point to the parts of the book it draws on.