← 返回命令列表

Linux command

docker-stats 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Show live stats for all containers

docker stats

Show stats for specific containers

docker stats [container1] [container2]

Show one-time snapshot

docker stats --no-stream

Custom output format

docker stats --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}"

Include stopped containers

docker stats -a

说明

docker stats displays a live stream of container resource usage statistics including CPU percentage, memory usage/limit, network I/O, and block I/O.

参数

-a, --all
Show all containers (default shows running).
--no-stream
Disable streaming, show single snapshot.
--no-trunc
Don't truncate output.
--format _string_
Format output using Go template.

FAQ

What is the docker-stats command used for?

docker stats displays a live stream of container resource usage statistics including CPU percentage, memory usage/limit, network I/O, and block I/O.

How do I run a basic docker-stats example?

Run `docker stats` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -a, --all do in docker-stats?

Show all containers (default shows running).