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

Create a free account to save this page, take notes and track your progress. Sign in

Syntax

docker stats [OPTIONS] [CONTAINER...]

Parameters

ParameterDescription
--no-stream Print one snapshot and exit.
--format TEMPLATE Choose columns, e.g. '{{.Name}} {{.MemUsage}}'.
-a Include stopped containers.

Examples

Memory limit of a container
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.

Available columns
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.

Was this page helpful?