37.8k views
3 votes
How to view approximate size of a running container?

A) docker size
B) docker inspect
C) docker ps
D) docker stats

User Raheel
by
7.5k points

1 Answer

2 votes

Final answer:

To view the approximate size of a running container, use 'docker ps --size'. The correct command 'docker stats' shows runtime metrics, not the size. 'docker ps --size' displays container sizes.

Step-by-step explanation:

To view the approximate size of a running container in Docker, you can use the docker ps command with a specific flag to include the size information. The correct command option from the choices given is D) docker stats. However, 'docker stats' shows the runtime metrics such as CPU, memory usage, I/O, and network stats, but not the size of the container's writable layer. To see the size of a container, you should use docker ps -s or docker ps --size. This command will show the list of running containers and include a column for size that shows the approximate size of the running containers.

User Keen
by
7.3k points