feat: docker cleanup timer

This commit is contained in:
Mathew Guest 2026-07-27 00:40:36 -06:00
parent 202459ea83
commit fd681eca9d
3 changed files with 28 additions and 0 deletions

@ -44,6 +44,11 @@ journalctl --user -u docker.service
journalctl gitea-act-runner.service
```
# Notes
* Now using arch gitea-runner package (official).
* Make sure to use /etc/gitea-runner/config.yaml
* Enable the cleanup timer to clean docker cache every now and then
# See also
* Mathew Guest: mat@zavage.net
* https://gitea.com/gitea/act_runner

@ -0,0 +1,13 @@
[Unit]
Description=Prune docker + runner cache (rootless CI cleanup)
[Service]
Type=oneshot
# Environment=DOCKER_HOST=unix:///run/user/1004/docker.sock
Environment=DOCKER_HOST=unix://%t/docker.sock
# keep one week of docker images/build cache, drop the rest
ExecStart=/usr/bin/docker system prune -af --filter until=168h
ExecStart=/usr/bin/docker builder prune -af --filter until=168h
# drop runner cache entries untouched for 2+ weeks
ExecStart=/usr/bin/find %h/.cache/actcache -type f -atime +14 -delete

@ -0,0 +1,10 @@
[Unit]
Description=Weekly CI cleanup
[Timer]
OnCalendar=Sun 04:00
Persistent=true
RandomizedDelaySec=15m
[Install]
WantedBy=timers.target