feat(docker): add aggressive cleanup mode#22
Merged
Conversation
Add two new cleanup operations beyond standard dangling-only pruning: - remove_all_unused_docker_images: prunes ALL images not referenced by any container (docker image prune -a), not just dangling/untagged ones. - prune_unused_docker_networks: removes custom networks not in use, preserving default bridge/host/none networks. Both require explicit confirmation (confirm_dangerous). Only offered interactively — skipped when --force is used. Integrated with --analyze and --dry-run. 3 new unit tests added. Closes #12 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
11 tests covering images, networks, dry-run, analyze mode, and full workflow. Uses isolated devsweep-e2e-* prefix for all resources. Closes #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two new aggressive Docker cleanup operations that go beyond the standard dangling-only pruning, reclaiming significantly more disk space from old/unused Docker resources.
New operations
remove_all_unused_docker_images— runsdocker image prune -a, removing ALL images not referenced by any container (not just dangling/untagged). Useful for cleaning up images from old projects you no longer run.prune_unused_docker_networks— runsdocker network prune, removing custom networks not attached to any container. Preserves defaultbridge,host, andnonenetworks.Safety design
confirm_dangerous(user must typeyes)--forceis used, keeping force mode limited to safe cleanup--dry-run(shows what would happen) and--analyze(collects size estimates in preview)Cleanup flow (updated)
Tests
3 new unit tests added, all 129 tests passing (118 unit + 11 e2e).
Closes #12