The container stats command

Another very useful Docker command is the stats command. It provides live, continually-updated usage statistics for one or more running containers. It is a bit like using the Linux top command. You can run the command with no parameters to view the stats for all running containers, or you can provide one or more unique container identifiers to view the stats for one or more container's specific containers. Here are some examples of using the command:

# using the new syntax, view the stats for all running containers# Usage: docker container stats [OPTIONS] [CONTAINER...]docker container stats# view the stats for just two web server containersdocker container stats web-server1 web-server2# using the old syntax, view ...

Get Docker Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.