Skip to content

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.

wheels deploy prune containers [--keep=<n>] [--destination=<name>] [--dry-run]
FlagDescription
--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-runPrint the commands without executing.

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
wheels deploy prune containers