How is the docker stats command used?
The docker stats command is used to display resource usage of Docker containers, including CPU utilization, memory usage, network IO, and disk IO. The usage method is as follows:
docker stats [OPTIONS] [CONTAINER...]
Options include:
- -show-all: display statistics for all containers, including those that are stopped.
- –format: specify the output format.
- –no-stream: Display statistics once only, do not continuously update.
- –no-trunc: Do not truncate output.
- “Only display statistics for containers created after the specified time.”
- -until: Display statistics only for containers created before the specified time.
示例:=
Example:
docker stats -a
This will display the resource usage of all containers.