← GHOST_MACHINES · CLEANUP

Cleanup — Levels 1–4

Four levels. Level 4 = full purge incl. GHCR prebuilts and builder cache.

clean.sh only handles the main docker-compose.yml (ghost-machine*).

Tenants use tenant.sh delete — they are a separate Compose project (ghost-tenant-<id>).

LevelCommandEffectWhen
1./clean.sh -sdown — containers + networkStop for the day, keep work + images
2./clean.sh -vdown -v — incl. Docker volumesVolumes are unused here (bind mounts), so rarely needed
3./clean.sh -a -ydown -v --rmi local + rmi *-template:latest (ubuntu/debian/alpine/arch)Rebuild from scratch, free ~1 GB local image per engine
4./clean.sh --nuke -yL3 + rmi ghcr.io/1999azzar/ghost-machine-*:latest + builder pruneFull purge — GHCR prebuilts (~1.2–1.6 GB each) + Buildx cache
4 hard./clean.sh --nuke --hard -yL4 + wipe mounts/True 1st-user nuke (also clears host work)

Tenants — Separate System

Tenants are not covered by clean.sh. They live under mounts/tenants/<id> and Compose project ghost-tenant-<id>.
./tenant.sh list # see active tenants
./tenant.sh delete alice -y # stops + removes container + mount
./tenant.sh delete alice --archive -y # saves snapshots/snapshot_alice_*.tar.gz first
./tenant.sh delete bob -y && ./tenant.sh delete carol -y # loop for many

Full Purge Example

# 1) remove all tenants
for t in $(./tenant.sh list 2>/dev/null | awk 'NR>2{print $1}'); do ./tenant.sh delete $t -y; done

# 2) nuke main + GHCR + builder
./clean.sh --nuke -y

What Is Kept Where

DataLocationRemoved by
Your code / homemounts/* (bind mounts)Never by clean.sh — manual rm
Tenant homesmounts/tenants/<id>tenant.sh delete
Local built images*-template:latestL3 / L4
GHCR prebuiltsghcr.io/1999azzar/ghost-machine-*:latestOnly L4 (--nuke)
← Back to Archival Procedures · GHOST_MACHINES · MIT