-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Phase 4: Cleanup Modules
Implement Docker/OrbStack cleanup module with safe and aggressive operations.
Implementation
In Infrastructure/Modules/Docker/DockerModule.cs
- Implements
ICleanupModule - Supports Docker Desktop and OrbStack
- Multi-tier cleanup strategy
Features to Port from Bash
Safe Operations
From src/modules/docker.sh:
- Remove stopped containers -
remove_stopped_containers - Remove dangling images -
remove_dangling_docker_images - Prune unused volumes -
prune_unused_docker_volumes - Clear build cache -
clear_docker_build_cache
Aggressive Operations (require confirmation)
- Remove ALL unused images -
remove_all_unused_docker_images - Prune unused networks -
prune_unused_docker_networks
Deep Cleanup (DESTRUCTIVE)
- Reset Docker Desktop data -
reset_docker_desktop_data - Cleanup OrbStack data -
cleanup_orbstack_data(macOS only)
AnalyzeAsync
- Check if Docker/OrbStack is available
- Estimate sizes for each operation
- Return
List<CleanupTarget>with appropriateConfirmationLevel
CleanAsync
- Execute operations based on mode
- Handle confirmations for aggressive operations
- Use
ICommandRunnerfor docker CLI commands - Return
List<CleanupResult>
Properties
Name: ModuleName.DockerDescription: "Clean Docker/OrbStack (containers, images, volumes)"IsDestructive: true (aggressive mode)IsAvailableOnPlatform: true for all (OrbStack only on macOS)
Tests to Port
All in tests/Infrastructure/Modules/Docker/DockerModuleTests.cs
Port tests from bash tests/unit/docker_test.sh and tests/e2e/docker_aggressive_test.sh:
- Safe operations
- Aggressive mode confirmations
- OrbStack detection (macOS only)
- Docker availability check
- Size estimation
Definition of Done
- DockerModule fully implemented
- All bash tests ported
- Safe and aggressive modes working
- OrbStack support on macOS
- ~5-20GB typical recovery
Reactions are currently unavailable