Skip to content

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. |

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.

  • 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 deploy already prunes at the end.