LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

docker-container-stats

display resource usage statistics for containers

TLDR

Show live resource usage
$ docker container stats
copy
Show stats for specific containers
$ docker container stats [container1] [container2]
copy
Show one-time snapshot
$ docker container stats --no-stream
copy
Custom format
$ docker container stats --format "{{.Name}}: {{.CPUPerc}}"
copy

SYNOPSIS

docker container stats [options] [container...]

DESCRIPTION

docker container stats displays a live stream of container resource usage statistics, providing real-time visibility into CPU percentage, memory usage and limit, network I/O, and block I/O for running containers.By default, the display continuously updates with current metrics for all running containers. The --no-stream option provides a single snapshot instead of continuous updates, which is useful for scripting and automation.

PARAMETERS

--no-stream

Disable streaming, show single snapshot.
-a, --all
Show all containers (default shows running).
--format string
Format output using Go template. Placeholders: .Container, .Name, .ID, .CPUPerc, .MemUsage, .MemPerc, .NetIO, .BlockIO, .PIDs.
--no-trunc
Do not truncate output (show full container IDs).

CAVEATS

On Linux, memory usage includes cache by default. Network I/O shows cumulative totals since container start, not per-second rates. Stats are not available for containers using the host network mode on some platforms.

SEE ALSO

Copied to clipboard
Kai