docker-container-ls
TLDR
List currently running Docker containers
List all Docker containers (running and stopped)
Show the latest created container (includes all states)
Filter containers that contain a substring in their name
Filter containers that share a given image as an ancestor
Filter containers by exit status code
Filter containers by status (created, running, removing, paused, exited, and dead)
Filter containers that mount a specific volume or have a volume mounted in a specific path
SYNOPSIS
docker container ls [OPTIONS]
PARAMETERS
--all, -a
Show all containers (default: running only). Incompatible with --last, -n
--filter, -f stringArray
Filter by conditions: ancestor, container, exited, health, id, image, isolation, label, name, network, publish, etc.
--format string
Pretty-print using Go template
--last, -n int
Show n last created containers (default: all). Incompatible with --all, -a
--no-trunc
Do not truncate output
-q, --quiet
Display only numeric container IDs
--size, -s
Display container and virtual sizes
DESCRIPTION
The docker container ls command (aliased as docker ps) lists Docker containers on the system. By default, it shows only running containers with key details: CONTAINER ID, IMAGE, COMMAND, CREATED, STATUS, PORTS, and NAMES.
This tool is essential for inspecting container states during development, debugging, and operations. Customize output with options to view all containers, apply filters (e.g., by status, name, or image), format as JSON or tables, limit to recent ones, suppress truncation, show sizes, or output only IDs for scripting.
For example, docker container ls -a displays all containers (running and stopped), while docker container ls -q lists only IDs. Filters like --filter status=paused narrow results. It integrates with Docker Engine's REST API under the hood, providing real-time snapshots without affecting running containers.
Ideal for CI/CD pipelines, server monitoring, and swarm clusters, it supports quiet mode for automation.
EXAMPLES
docker container ls
List running containers.
docker container ls -a -q
List all container IDs.
docker container ls --filter "status=exited"
Show exited containers.
NOTE
docker ps is an alias; use docker container ls for consistency with subcommands.
HISTORY
Introduced in Docker 0.7.0 (2014); docker ps alias added for backward compatibility. Evolved with filtering, formatting in Docker 1.13+; now part of Docker CLI v27+.
SEE ALSO
docker ps(1), docker-image-ls(1), podman ps(1)


