Command Line Tools
wheels deploy prune
Disk cleanup. Three verbs with increasing scope.
| Verb | Removes |
|---|---|
all | Old stopped containers + the service’s unused images. |
images | The service’s unused images only. |
containers | Old stopped 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.
wheels deploydoes not prune; run these verbs yourself.