# docker stats Command Reference

> Reference for docker stats in CI: stream or snapshot live CPU, memory, and network usage of containers with --no-stream and --format for scripting.

Source: https://latchkey.dev/learn/command-reference/docker-stats-command-reference  
Updated: 2026-06-26

Show live resource usage of containers.

docker stats displays a live stream of CPU, memory, network, and block I/O for running containers. In CI you almost always add --no-stream to take a single snapshot, since the default streaming output never returns.

## Common flags

- `--no-stream` - print a single snapshot and exit (essential in CI)
- `-a, --all` - include non-running containers
- `--format` - Go template output, e.g. "{{.Name}} {{.MemUsage}}"
- `--no-trunc` - do not truncate output

## Example

```shell
docker stats --no-stream --format "{{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}"
```

## In CI

Use docker stats --no-stream to capture a one-shot resource snapshot when debugging an OOM-killed container or a slow integration run. Without --no-stream the command blocks forever and the step times out.

## FAQ

### docker stats Command Reference?

docker stats displays a live stream of CPU, memory, network, and block I/O for running containers. In CI you almost always add --no-stream to take a single snapshot, since the default streaming output never returns.

### In CI?

Use docker stats --no-stream to capture a one-shot resource snapshot when debugging an OOM-killed container or a slow integration run. Without --no-stream the command blocks forever and the step times out.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
