Docker Engine 29 reference · Containers
docker stats Command (Docker CLI)
Show live CPU, memory, network and disk I/O usage per container; use --no-stream for a single snapshot in scripts.
Docker Engine 29
Syntax
docker stats [OPTIONS] [CONTAINER...]
Parameters
| Parameter | Description |
|---|---|
--no-stream |
Print one snapshot and exit. |
--format TEMPLATE |
Choose columns, e.g. '{{.Name}} {{.MemUsage}}'. |
-a |
Include stopped containers. |
Examples
docker run -d --name rc-ref-stats --memory 64m alpine:3.24 sleep 300 > /dev/null
docker stats --no-stream --format '{{.Name}} memory limit: {{.MemUsage}}' rc-ref-stats | sed -E 's/: .* \/ /: /'
docker rm -f rc-ref-stats > /dev/null
Output
rc-ref-stats memory limit: 64MiB
Run this on your computer — see “Get Started” for setup.
docker run -d --name rc-ref-stats2 alpine:3.24 sleep 300 > /dev/null
docker stats --no-stream --format '{{.Name}} has columns: CPUPerc MemUsage NetIO BlockIO PIDs' rc-ref-stats2
docker rm -f rc-ref-stats2 > /dev/null
Output
rc-ref-stats2 has columns: CPUPerc MemUsage NetIO BlockIO PIDs
Run this on your computer — see “Get Started” for setup.
Related
docker inspect· Show the low-level JSON configuration and state of containers, images, volumes or networks; extract fields with --format.- Memory and CPU Limits · tutorial