Back to lessons

Hosting Operations

Summarize Docker Disk Usage

The host disk is full and you need a safe storage summary before cleanup.

Command

docker system df -v

What changed

Nothing changes. Docker reads storage accounting data.

Danger

safe

When to use it

Use before cleanup decisions to understand whether images, containers, volumes, or build cache are responsible.

When not to use it

Do not treat reclaimable space as safe to delete until you verify ownership and backups.

Undo or recovery

No undo needed because this command is read-only.

Expected output

A Docker disk usage summary with reclaimable space estimates.

demo script

Disposable terminal steps

  1. docker system df -v
  2. docker volume ls

simulated output

What it looks like

disposable vessel
::fixture-ready::
$ docker system df -v
TYPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE
Images          8         3         2.8GB     1.1GB (39%)
Containers      5         2         240MB     180MB (75%)
Local Volumes   4         3         1.7GB     200MB (11%)
Build Cache     12        0         620MB     620MB
::exit-code::0
$ docker volume ls
DRIVER    VOLUME NAME
local     app_postgres_data
local     app_uploads
::exit-code::0

YouTube Short

Docker disk usage safely.

When Docker fills a disk, do not start with prune. Start with docker system df -v.

LinkedIn hook

See how Docker storage is split across images, containers, volumes, and cache.

Question: What Docker storage category has surprised you most during disk incidents?

experiments

A/B tests to run

Metric: share_rate

A: Do not start Docker disk triage with prune.

B: Find the Docker disk culprit before deleting anything.