The Docker daemon inside the gitea-runner container keeps every job image and all build cache in the gitea-runner_docker volume on the root SSD that production k3s also uses. It grew to 16G in the two days after the runner was installed and held 12.43G of images and 8.44G of build cache on 2026-11-11. The README only said to look once a week and prune by hand. Mount daemon.json into the runner so the inner BuildKit GC keeps 2GB to 10GB of build cache, and shrinks to 2GB while the disk has less than 35GB free. Add gitea-runner-prune.service and .timer, a host systemd timer for Sunday 04:30 KST that removes unused images created more than 7 days ago and build cache older than 3 days. The service runs as donghyeon in the docker group, so it needs root only to install. A user timer was rejected because lingering is off for donghyeon and user units stop with the last login session. Risk: image prune filters on image creation time, so the pinned job image is deleted weekly and the next job pulls about 543MB again. Recreating the runner to pick up daemon.json cancels a running job, so it is done only while the runner is idle. Verification: systemd-analyze verify passes for both units, and the calendar expression's next run is Sun 2026-11-15 04:30 KST. docker compose config passes; dockerd --validate inside the runner (Docker 29.9.3) accepts daemon.json.
11 lines
174 B
JSON
11 lines
174 B
JSON
{
|
|
"builder": {
|
|
"gc": {
|
|
"enabled": true,
|
|
"defaultReservedSpace": "2GB",
|
|
"defaultMaxUsedSpace": "10GB",
|
|
"defaultMinFreeSpace": "35GB"
|
|
}
|
|
}
|
|
}
|