docker-cleanup

Remove unused Docker images, BuildKit cache, and detached volumes with storage reporting.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/neon-law-foundation/navigator --skill docker-cleanup-neon-law-foundation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docker-cleanup
Source: https://github.com/neon-law-foundation/navigator/tree/main/.claude/skills/docker-cleanup
Command: npx skills add https://github.com/neon-law-foundation/navigator --skill docker-cleanup-neon-law-foundation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers recover disk space consumed by Docker after repeated builds, image churn, and long-running test activity. It also prevents unsafe cleanup by separating harmless cleanup from destructive volume removal.

Core Features & Use Cases

  • Stage-based cleanup: Removes unused images first, then BuildKit cache, and only prunes volumes with explicit confirmation.
  • Orphaned container recovery: Targets leaked running test containers that can exhaust Docker networking and block new builds.
  • Safe reporting: Shows storage usage before and after cleanup so reclaimed space is visible.
  • Use case: A developer whose laptop is full after many rebuilds can free space without accidentally deleting active container data.

Quick Start

Ask the assistant to clean up Docker disk usage on this machine and report the before-and-after storage summary.

Frequently Asked Questions about docker-cleanup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reclaim Docker disk space safely without deleting running containers?

Docker disk space is reclaimed by removing unused images first, then BuildKit cache, and only pruning volumes with explicit confirmation. This staged cleanup preserves running containers by default while freeing space consumed by repeated builds.

What is the best way to clean up Docker build cache and orphaned volumes?

The best way to clean up Docker build cache and orphaned volumes is a staged approach: remove unused images, clear BuildKit cache, then confirm volume pruning. This prevents accidental data loss while recovering maximum disk space.

Why does Docker take up so much disk space after repeated rebuilds and test runs?

Docker disk space grows after repeated rebuilds and test runs due to accumulated unused images, BuildKit cache, and detached volumes. Orphaned test containers also consume networking resources and storage, blocking new builds and exhausting available space.

Can I see how much Docker storage is freed after pruning unused images and volumes?

Yes, storage reporting shows before-and-after usage so reclaimed Docker disk space is visible. This safe reporting confirms exactly how much space was recovered from removing unused images, build cache, and pruned volumes.

Does Docker volume pruning delete active container data?

Docker volume pruning is treated as destructive and only executes after explicit confirmation. The cleanup process preserves running containers by default, ensuring active container data remains intact while targeting only orphaned and detached volumes.

What's the safest Docker cleanup process for developer workstations and build environments?

The safest Docker cleanup process for developer workstations and build environments stages removal by targeting unused images first, then BuildKit cache, and finally volumes with confirmation, while preserving running containers and reporting before-and-after storage.