Publish: 2020-10-26 | Modify: 2020-10-26
The docker stats
command displays container resource usage and provides real-time information. To limit the data to one or more specific containers, separate the container IDs with spaces. You can also specify a stopped container, but a stopped container doesn't return any data.
Simply enter docker stats
to display resource usage for all running containers. You will see screenshot-like information similar to the following:
The meanings of each column are as follows:
You can also use docker stats
with one or more container IDs or names, for example:
# View resource usage for a single container (by ID)
docker stats 7c3e162bef49
# View resource usage for a single container (by name)
docker stats name
# View resource usage for multiple containers
docker stats xxx xxx
If no container ID or name is specified, it defaults to displaying resource usage for all running containers. You can also specify a stopped container, but a stopped container doesn't return any data.
The docker stats
command can also format the results. For more information, please refer to the official documentation: docker stats
I come from China and I am a freelancer. I specialize in Linux operations, PHP, Golang, and front-end development. I have developed open-source projects such as Zdir, ImgURL, CCAA, and OneNav.