Server cleanup
Docker cleanup, reclaiming disk on a server. One schedule for the instance, individual hosts opt out.
Settings -> Servers, the server, Cleanup. One Scheduled cleanup policy covers every server, including ones you add later; a server opts out with Include this server.
It ships on: every scope below, daily at 0 4 * * * (UTC), a 24-hour minimum age and one image
kept per app. A scope added by a later release turns itself on in a policy you already saved.
What gets cleaned
Prop
Type
- Live apps are safe. Every scope judges against what this Deplo still knows about, so a stopped app, or one moving between servers, keeps its images, files and network.
- Swept after every deploy too: Unused app images and Build cache, so a day of builds can't fill the disk before the schedule runs.
- The build cache has a ceiling: a tenth of the server's disk, between 2 GB and 50 GB. Past it, the oldest cache goes even when younger than the minimum age.
- Never run:
system prune, container, volume or network prune. A container, and anything a container still uses, is never touched.
Settings
Prop
Type
What cleanup does not touch
- Named volumes with data, and server folders an app reached through a Bind. Deleting an app does not free them: they are yours to remove.
- Backup files. Deleting a backup schedule leaves its copies in the destination.
- A migration source, scheduled or on demand: that machine is somebody else's platform until you are done with it.
Troubleshooting
| Symptom | What to check |
|---|---|
| Cleanup frees nothing | The build cache is under its ceiling and the minimum age protects the rest, or what fills the disk is images your apps still use. |
| Rollbacks stopped working after a sweep | An app that can roll back keeps what its own Keep says: raise it there. Images kept per app only covers apps that can't. |
| A redeploy can't pull an image cleanup removed | The server has no access to that registry. Untick Unused pulled images, which applies to every server, or turn off Include this server there. |
More in Servers and agents.
Next steps
Did this page help you?