Repository navigation
status
This document explains exactly how DAM's status command works, including cross-project querying, aggregated status reporting, and resource usage statistics.
Unlike other lifecycle operations (like start or stop) that execute sequentially inside each app's directory, the status command aggregates information across all selected apps simultaneously. It provides a high-level, consolidated view of container states and real-time resource consumption without changing any container states.
When the status command is executed, DAM bypasses individual docker compose calls and instead interacts directly with the Docker engine to gather data efficiently:
Before displaying any output, DAM identifies all containers belonging to the selected apps:
docker ps -a --filter "label=com.docker.compose.project" \
--format '{{.ID}}|{{.Label "com.docker.compose.project"}}|{{.Label "com.docker.compose.project.working_dir"}}'It matches the found project names (and working directories) against your requested apps to build a complete, accurate list of relevant container IDs. This approach successfully discovers containers even if they were started outside of DAM.
If containers are found for the requested apps, DAM queries their state:
docker ps -a -f "id=<cid1>" -f "id=<cid2>" ... \
--format 'table {{.Names}}\t{{.Label "com.docker.compose.project"}}\t{{.Label "com.docker.compose.service"}}\t{{.Image}}\t{{.RunningFor}}\t{{.Status}}\t{{.Ports}}'DAM formats the standard Docker process list to provide a clear, app-centric view.
- The output table modifies standard headers to specifically highlight the APP (
com.docker.compose.project) and SERVICE (com.docker.compose.service) labels. - This provides a clean overview of what is running, exited, starting, or unhealthy across all selected applications in one table.
After displaying states, DAM captures a point-in-time snapshot of the resource consumption for all identified containers:
docker stats --no-stream <cid1> <cid2> ...- Shows CPU percentage, Memory usage/limit, Network I/O, and Block I/O for each container.
- The
--no-streamflag ensures the command prints the current metrics once and immediately exits, returning you to your prompt instead of taking over the terminal.
┌─────────────────┐
│ status <app> │
└────────┬────────┘
│
▼
┌──────────────────┐
│ Query docker ps │
│ for matching apps│
└────────┬─────────┘
│
┌───────────┴───────────┐
│ │
Containers No Containers
Found Found
│ │
▼ ▼
┌──────────────────┐ ┌─────────────────┐
│ Show aggregated │ │ Print warning: │
│ docker ps table │ │ "No containers │
└────────┬─────────┘ │ found..." │
│ └─────────────────┘
▼
┌──────────────────┐
│ Show resource │
│ usage with │
│ docker stats │
└──────────────────┘
# View status for a single app
dkr status <app-name>
# View aggregated status for multiple apps
dkr status <app-name> <app-name-2> <app3>
# View status for all available apps
dkr status all
# View status for all apps except specific apps
dkr status all except <app3>