Uses Janitor to clean up old images from the server. Called once weekly
Find a file
GeorgeWebberley 9f12088da9 Added README
2026-02-02 20:58:52 +01:00
.woodpecker.yaml Cleans up old images 2026-01-26 12:40:41 +01:00
README.md Added README 2026-02-02 20:58:52 +01:00

Image Cleanup

This repository manages a simple maintenance utility used to keep the server's Docker environment clean. It prevents disk space exhaustion by removing unused data.

🛠️ Functionality

The service executes a deep cleanup of the Docker system using the following command:

docker system prune -af --volumes

This command removes:

  • All stopped containers.
  • All networks not used by at least one container.
  • All images without at least one container associated with them.
  • All build cache.
  • All unused volumes.

📅 Automation Schedule

The cleanup is managed by Woodpecker CI and is triggered in two ways:

  • Weekly Cron: A scheduled task that runs once a week to ensure the host doesn't accumulate "cruft" over time.
  • Manual Push: Any push to the main branch will trigger an immediate cleanup, allowing for on-demand maintenance.

📂 Repository Structure

.woodpecker.yaml: Defines the cleanup logic and the triggers (cron and push events).

⚠️ Important Note

Since this service uses the -a (all) and --volumes flags, it is very thorough. Ensure that any data you wish to persist is explicitly mapped to a persistent volume or handled by a running container, as unreferenced volumes will be purged.