Inspecting Storage Usage (docker system df)
Inspect image, container, and volume disk usage with docker system df.
In plain words
Inventory before cleanup and trend the reclaimable space against deployment cadence.
Think of it like…
system df is the warehouse inventory sheet, not the destruction order; a large reclaimable number still needs an owner and retention decision.
Where you’ve seen it
In practice, docker system df --format "{{.Type}}\t{{.Size}}\t{{.Reclaimable}}" && docker system df -v is the concrete move for this job: inspect image, container, and volume disk usage with docker system df. The release is not accepted until reconcile the top image, container and build-cache rows with the retention policy before invoking any prune class confirms the result.
Words you’ll hear
- system df
- The implementation control in
docker system df --format "{{.Type}}\t{{.Size}}\t{{.Reclaimable}}" && docker system df -vfor inspect image, container, and volume disk usage with docker system df. - Usage
- The result to observe with
reconcile the top image, container and build-cache rows with the retention policy before invoking any prune class, rather than infer from a successful command alone. - Reclaim
- The production boundary exposed when adding all Size values as if layers are not shared, or deleting the largest volume because it is marked reclaimable.
Visual diagram
Theory & deep dive
system df control path
The concrete mechanism is docker system df --format "{{.Type}}\t{{.Size}}\t{{.Reclaimable}}" && docker system df -v. The observable result is reconcile the top image, container and build-cache rows with the retention policy before invoking any prune class; if those disagree, inspect the runtime evidence before changing unrelated settings.
Inspect image, container, and volume disk usage with docker system df. Keep system df, Usage and Reclaim in the same deployment record so the intent and the observed state cannot drift apart.
docker system df --format "{{.Type}}\t{{.Size}}\t{{.Reclaimable}}" && docker system df -v
reconcile the top image, container and build-cache rows with the retention policy before invoking any prune class, not with command success alone.Reclaim failure boundary
The headline total double-counts shared layer intuition and can mislead teams: local volume data may be the largest bucket but is excluded from ordinary prune. A dangling image can be safe to remove while an orphaned named volume is business data. The narrow failure to design for is adding all Size values as if layers are not shared, or deleting the largest volume because it is marked reclaimable.
Accept this compromise explicitly: The summary is fast and scriptable; deeper filesystem and vendor-volume monitoring explains who is growing and why. The controlled check-reconcile the top image, container and build-cache rows with the retention policy before invoking any prune class-also identifies the point where a different design is safer.
Exercise this failure safely: adding all Size values as if layers are not shared, or deleting the largest volume because it is marked reclaimable.
How it works, step by step
Step 1 of 41. State the boundary
Write down why the workload needs this: The headline total double-counts shared layer intuition and can mislead teams: local volume data may be the largest bucket but is excluded from ordinary prune. A dangling image can be safe to remove while an orphaned named volume is business data.
- Intent
- system df
When to use it & trade-offs
What it is
docker system df summarizes space used and reclaimable by images, containers, local volumes and build cache. -v expands the table to identify individual objects, shared sizes and which stopped or dangling artifacts account for the totals.
Why it matters: The headline total double-counts shared layer intuition and can mislead teams: local volume data may be the largest bucket but is excluded from ordinary prune. A dangling image can be safe to remove while an orphaned named volume is business data.
When to reach for it
- The fit is strongest for this job: inspect image, container, and volume disk usage with docker system df. Pair it with
reconcile the top image, container and build-cache rows with the retention policy before invoking any prune classin the runbook. - Production system df changes should make Usage observable through
docker system df --format "{{.Type}}\t{{.Size}}\t{{.Reclaimable}}" && docker system df -v, rather than trusting the runtime default. - Keep a rollback example for the case where adding all Size values as if layers are not shared, or deleting the largest volume because it is marked reclaimable.
When to avoid or be careful
- Do not accept command success while the system can still fail by adding all Size values as if layers are not shared, or deleting the largest volume because it is marked reclaimable.
- Avoid erasing Reclaim protection merely to dodge this cost: “The summary is fast and scriptable; deeper filesystem and vendor-volume monitoring explains who is growing and why”.
- Do not replace the evidence path-
reconcile the top image, container and build-cache rows with the retention policy before invoking any prune class-with a screenshot or a mutable tag.
docker system df --format "{{.Type}}\t{{.Size}}\t{{.Reclaimable}}" && docker system df -v: practical choices
Strengths: docker system df summarizes space used and reclaimable by images, containers, local volumes and build cache. -v expands the table to identify individual objects, shared sizes and which stopped or dangling artifacts account for the totals.
Watch out: The summary is fast and scriptable; deeper filesystem and vendor-volume monitoring explains who is growing and why.
Strengths: It can begin with docker system df --format "{{.Type}}\t{{.Size}}\t{{.Reclaimable}}" && docker system df -v and fewer surrounding controls.
Watch out: It silently accepts adding all Size values as if layers are not shared, or deleting the largest volume because it is marked reclaimable, which makes the result hard to reproduce after promotion.
Strengths: The headline total double-counts shared layer intuition and can mislead teams: local volume data may be the largest bucket but is excluded from ordinary prune. A dangling image can be safe to remove while an orphaned named volume is business data.
Watch out: The platform adds an ownership and debugging layer; retain reconcile the top image, container and build-cache rows with the retention policy before invoking any prune class as the direct check.
Interview signals & numbers to know
When this topic comes up
- docker system df --format "{{.Type}}\t{{.Size}}\t{{.Reclaimable}}" && docker system df -v
- reconcile the top image, container and build-cache rows with the retention policy before invoking any prune class
- Failure signature: adding all Size values as if layers are not shared, or deleting the largest volume because it is marked reclaimable
- Trade-off: The summary is fast and scriptable; deeper filesystem and vendor-volume monitoring explains who is growing and why.
Benchmarks & rules of thumb
- 4 object groups
- images, containers, volumes and build cache
- 2 size views
- unique/sharable and current/reclaimable summaries
- 1 pre-cleanup snapshot
- should be saved for change comparison
Common mistakes & follow-ups
Common interview mistakes
- Treating a successful
docker system df --format "{{.Type}}\t{{.Size}}\t{{.Reclaimable}}" && docker system df -vas proof and skippingreconcile the top image, container and build-cache rows with the retention policy before invoking any prune class. - Adding all Size values as if layers are not shared, or deleting the largest volume because it is marked reclaimable
- Optimizing system df without accepting that the summary is fast and scriptable; deeper filesystem and vendor-volume monitoring explains who is growing and why.
Likely interviewer follow-ups
- Why does
docker system df --format "{{.Type}}\t{{.Size}}\t{{.Reclaimable}}" && docker system df -vaddress system df here rather than through application code? - How would you distinguish healthy Usage from the failure “adding all Size values as if layers are not shared, or deleting the largest volume because it is marked reclaimable” using
reconcile the top image, container and build-cache rows with the retention policy before invoking any prune class? - When would this trade-off-“The summary is fast and scriptable; deeper filesystem and vendor-volume monitoring explains who is growing and why”-justify a different Reclaim design?
docker system df --format "{{.Type}}\t{{.Size}}\t{{.Reclaimable}}" && docker system df -v-and one proof-reconcile the top image, container and build-cache rows with the retention policy before invoking any prune class. Then name the boundary: adding all Size values as if layers are not shared, or deleting the largest volume because it is marked reclaimable.Knowledge check
Put it into practice
Practice related interview Q&A
Apply Inspecting Storage Usage (docker system df) with generative AI interview Q&A and hands-on practice.