The docker stats command provides you with the capability to view the memory, CPU, and the network usage of a container from a Docker host machine, as illustrated here:
$ sudo docker stats a245253db38b
CONTAINER CPU % MEM USAGE/LIMIT MEM % NET I/O
a245253db38b 0.02% 16.37 MiB/992.5 MiB 1.65%
3.818 KiB/2.43 KiB
You can run the stats command to also view the usage for multiple containers:
$ sudo docker stats a245253db38b f71b26cee2f1
Docker provides access to container statistics read only parameters. This streamlines the CPU, memory, network IO, and block IO of containers. This helps you choose the resource limits and also in profiling. The Docker stats utility provides you with these resource usage details only for running containers.