Command Line Tools
wheels deploy prune containers
Prune old containers beyond the retention window (--keep=<n>, default 5) on every host. The current live container and everything in the retention window survives.
Synopsis
Section titled “Synopsis”wheels deploy prune containers [--keep=<n>] [--destination=<name>] [--dry-run]| Flag | Description |
|---|---|
--keep=<n> | How many old (stopped) containers to keep per host. Default 5. There is no deploy.yml equivalent — Kamal’s retain_containers: is rejected by the config validator. |
--destination=<name> | Overlay destination config. |
--dry-run | Print the commands without executing. |
Behavior
Section titled “Behavior”Per host, walks the service-labelled container list, sorts by creation time, and docker rms anything older than the retention window. Older versions become unrollbackable after this — check wheels deploy app containers first if you might need them.
Example
Section titled “Example”wheels deploy prune containers