Skip to content
🎉 Launch sale:50% off everything over $22 — automatically applied at checkout· ends Aug 2Shop the sale →
DevOps AI ToolKit
Newsletter
advanced Premium Production Operations · ⏱ 35 min

Resolve Docker Disk Exhaustion

Scenario

Alerts are firing: the Docker host is at 96% disk. You must locate the biggest consumers, clean up safely without deleting live data, and configure log rotation so it doesn’t happen again.

Learning objectives

  • Measure Docker disk usage
  • Locate oversized container logs
  • Identify unused images and stopped containers
  • Reclaim space without touching live data
  • Configure log rotation

Before you start

Required software: Docker Engine 24+ (Linux recommended)

Prerequisites: Docker Monitoring & Troubleshooting path

  1. Download and unzip the lab.
  2. Start it: docker compose up -d (a noisy service will generate large logs).

Instructions

Full instructions are part of Individual Pro

Unlock the step-by-step instructions, the solution guide, validation scripts, and downloadable files.

Unlock with Pro

Hints

💡 Where is the space going?

docker system df -v breaks usage down by images, containers, volumes, and build cache. Container logs live outside this — check /var/lib/docker/containers/*/*-json.log sizes.

💡 Prune without data loss

docker image prune (dangling) and docker container prune are safe; docker system prune --volumes is NOT — it can delete named volumes with real data. Be specific.

Validate your work

From the lab folder, run:

bash validation/validate.sh

The script reads only your local Docker state, never transmits data off your machine, and returns a status code:

  • 0 — Lab successfully completed
  • 1 — Validation failed
  • 2 — Required dependency missing
  • 3 — Lab environment not running
  • 4 — Configuration error
  • 5 — Validation timed out

Note: validation targets Linux first. On Docker Desktop (macOS/Windows) some host-level checks (e.g. disk usage) may report differently; each script documents its limitations.

Solution

The full solution + troubleshooting explanation is available to Individual Pro members. Try to solve it first — that’s where the learning is.

Upgrade to Pro

Reset the lab

  • docker compose down -v && docker compose up -d from the original lab files restores the starting (broken) state.

Interview questions

  • What does `docker system df` show and how do you get per-object detail?
  • Which prune commands are safe on a production host and which are dangerous?
  • How do you cap a container’s log size?

Finished this lab?

Sign in to record your completion and track progress across the path. Completion is recorded server-side.

Related labs