Skip to main content

1. Clear the Build Cache

When you build images, Docker keeps layers cached to speed up future builds. To clear just that cache:
To remove all build cache (even from unused builders):
You’ll be prompted for confirmation — add -f to skip it:

2. Remove Unused Data (Safe Global Cleanup)

This removes:
  • stopped containers
  • unused networks
  • dangling images
  • build cache
Run:
For a more aggressive cleanup (includes unused images and volumes):
Be careful — this deletes everything not actively in use by a running container.

3. Remove All Containers, Images, and Volumes

If you want a total reset:

4. Check Disk Usage Before/After

See what’s taking space:

Common cleanup combo (safe and effective)