docker compose ls Command
The docker compose ls command is used to list all Docker Compose projects in the current system and their status.
The docker compose ls command helps you quickly see which Compose projects are running or in other states.
Syntax
docker compose ls [OPTIONS]
OPTIONS:
--all: Show all projects, including those that are not started.--filter: Filter the output based on conditions. For example, you can filter by status.--format: Specify the output format (such astable、jsonetc.).--quiet: Show only project names, without other information.
Output information:
docker compose ls The output information includes the following fields:
- Name: Project name.
- Status: The status of the project (for example,
running、exitedetc.). - Config Files: The path to the
docker-compose.ymlfile associated with the project.
Example
1. List all running Docker Compose projects
docker compose ls
Show all currently running projects and their status.
2. List all projects (including those that are not started)
docker compose ls --all
Show all Compose projects, including those that are not started.
3. Show only project names
docker compose ls --quiet
Only returns project names, without detailed information.
4. Filter projects by status
docker compose ls --filter "status=running"
Only shows projects with status running.
Docker Command Reference