How to check the status and space used by images and containers

This post objective is to find out the stats of running container, system information related to space used by images and containers on /var/lib/docker.

1. ‘docker stats‘ command used to check the containers stats on system like CPU usage, IO usage, Memory usage. Below example is for 2 running containers dockerweb and webserver2.

# docker stats dockerweb webserver2
CONTAINER ID   NAME       CPU   % MEM USAGE / LIMIT   MEM %    NET I/O      BLOCK I/O       PIDS
e33f00e0e3ce dockerweb   0.00%  7.934MiB / 975.9MiB  0.81%   2.64kB / 0B  14.5MB / 0B        9
ab9e9c22b93c webserver2  0.00%  6.98MiB / 975.9MiB   0.72%   1.87kB / 0B  13.1MB / 0B        6

2. ‘docker system df‘ command is used to check number of docker images and containers on system with space usage.

# docker system df
TYPE         TOTAL ACTIVE    SIZE    RECLAIMABLE
Images         6     4     1.415GB   237.3MB (16%)
Containers     9     1     407.2MB   407.2MB (99%)
Local Volumes  0     0       0B          0B
Build Cache    0     0       0B          0B
Related Post