docker compose ls Command
The docker compose ls command is used to list all Docker Compose projects and their status in the current system.
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: Shows all projects, including unstarted ones.--filter: Filter the output results based on conditions. For example, you can filter by status.--format: Specify the output format (such astable、jsonetc.).--quiet: Only displays project names, without other information.
Output information:
docker compose lsThe output information includes the following fields:
- Name: Project name.
- Status: The project's status (for example
running、exitedetc.). - Config Files: Associated with the project
docker-compose.ymlFile path.
Example
1. List all running Docker Compose projects
docker compose ls
Display all currently running projects and their status.
2. List all projects (including unstarted ones)
docker compose ls --all
Shows all Compose projects, including those that are not started.
3. Display only project names
docker compose ls --quiet
Returns only project names, without detailed information.
4. Filter projects by status
docker compose ls --filter "status=running"
Only shows projects whose status is running.
other extensions