ddev-docker-cleanup

Installation
SKILL.md

DDEV / Docker Cleanup

Reclaim local disk and memory from DDEV and Docker without deleting anything the user still needs. The scripts do the deterministic work. Your job is to run them in order, present the results, and get explicit confirmation before anything is removed.

The safety model (read this first)

A DDEV project's database does not live in the project folder. It lives in a Docker volume, and it is not checked into git. If that volume is deleted, or the Docker provider is factory reset, the database is gone. This is why blunt cleanup commands are dangerous here.

Two rules follow from that, and the scripts enforce them:

  1. The only trustworthy allowlist of volumes to keep is the set of projects currently in ddev list, plus the DDEV global volumes. Everything else is a leftover.
  2. Never run docker volume prune, docker system prune --volumes, or docker image prune -a. When projects are stopped their volumes look "unused" and "100% reclaimable," but that is just because nothing is attached. Those commands would wipe stopped-project databases or force a full image re-pull. Do not suggest them even if the user asks, without first explaining what they would destroy.

Build cache and dangling images are safe to remove. They are rebuilt or re-pulled on the next ddev start.

Workflow

Always follow this order. Do not skip the report, and do not run --apply before the user has seen the dry run.

Installs
1
GitHub Stars
17
First Seen
12 days ago
ddev-docker-cleanup — kanopi/cms-cultivator