Command Line Tools
wheels deploy prune
Disk cleanup. Three verbs with increasing scope.
| Verb | Removes |
|---|---|
all | Old containers + old images. |
images | Old images only. |
containers | Old containers only. |
Retention policy
Section titled “Retention policy”The --keep=<n> flag on prune all and prune containers controls how many old containers per host are kept (default 5). There is no deploy.yml key for this — Kamal’s retain_containers: is rejected by the config validator (unknown top-level key); pass --keep on the command line instead. Prune verbs never touch the current live container or anything within the retention window. Older items are fair game.
When to prune
Section titled “When to prune”- After several successful deploys, disk pressure grows on each host.
- Before a container-registry rotation, to make sure you aren’t pinning stale base images.
- Never as part of a regular deploy flow —
wheels deployalready prunes at the end.