Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

docker compose ps command

docker compose ps command

Docker Command ReferenceDocker Command Reference


The docker compose ps command lists containers related to a Docker Compose project and their status.

docker compose ps can display information such as the running status and port mappings of all service containers in the current project.

Syntax

docker compose ps [OPTIONS] [SERVICE...]

OPTIONS:

Output information

Example

1. List all running containers



docker compose ps

Shows the containers currently running in the project and their status.

** 2. List all containers (including stopped ones)**



docker compose ps -a

Lists the status of all containers, including stopped ones.

** 3. Show only container IDs**



docker compose ps -q

Only returns container IDs, without other detailed information.

** 4. List the names of all services**



docker compose ps --services

Shows only service names, without listing detailed container information.

** 5. Filter containers by status**



docker compose ps --filter "status=running"

Only lists containers with status "running".


Docker Command ReferenceDocker Command Reference