1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 22:30:08 +00:00

feat(clean): add opt-in Docker unused data pruning (#554)

* feat(clean): add opt-in Docker unused data pruning

* fix(clean): make docker prune default

---------

Co-authored-by: Tw93 <hitw93@gmail.com>
This commit is contained in:
Nour
2026-03-10 11:20:40 +03:00
committed by GitHub
parent 2f627ac3df
commit 65b0db4e1c
2 changed files with 38 additions and 7 deletions

View File

@@ -198,13 +198,18 @@ clean_dev_docker() {
fi
stop_section_spinner
if [[ "$docker_running" == "true" ]]; then
clean_tool_cache "Docker build cache" docker builder prune -af
# Remove unused images, stopped containers, unused networks, and
# anonymous volumes in one pass. This maps better to the large
# reclaimable "docker system df" buckets users typically see.
clean_tool_cache "Docker unused data" docker system prune -af --volumes
else
echo -e " ${GRAY}${ICON_WARNING}${NC} Docker unused data · skipped (daemon not running)"
note_activity
debug_log "Docker daemon not running, skipping Docker cache cleanup"
fi
else
note_activity
echo -e " ${YELLOW}${ICON_DRY_RUN}${NC} Docker build cache · would clean"
echo -e " ${YELLOW}${ICON_DRY_RUN}${NC} Docker unused data · would clean"
fi
fi
safe_clean ~/.docker/buildx/cache/* "Docker BuildX cache"