List and filter running and stopped containers with docker ps

domain: docs.docker.com · 6 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. List only running containers: `docker ps` (alias of docker container ls).
  2. List ALL containers including stopped/exited: `docker ps -a`.
  3. Filter by status: `docker ps -a --filter status=exited` or `status=running`; filter by name substring: `docker ps -f name=nostalgic`.
  4. Filter by image: `docker ps -f ancestor=ubuntu:24.04`; filter by exit code with `-a` (e.g. `docker ps -a -f exited=137` for SIGKILL).
  5. Show only container IDs: `docker ps -q`; format output with --format (e.g. `docker ps --format '{{.ID}} {{.Names}} {{.Status}}'`).
  6. Official docs: https://docs.docker.com/reference/cli/docker/container/ps/

Known gotchas

Related routes

Stop, start, and restart Docker containers
docs.docker.com · 6 steps · unrated

Give your agent this knowledge — and 17,100+ more routes

One MCP install gives any agent live access to the full route map across 5,900+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans