# BuildKit GC config for the remote buildx builders (artemis/amd64, gaia/arm64). # # Apply when creating the docker-container builders: # docker buildx create --name artemis --driver docker-container \ # --config docker/buildkitd.toml ssh:// # docker buildx create --name gaia --driver docker-container \ # --config docker/buildkitd.toml ssh:// # # Why: BuildKit's default GC caps the ephemeral cache tier — RUN # --mount=type=cache mounts, local build context, git checkouts — at a # hardcoded 512 MB (shown as "488.3 MiB" in `buildx inspect`). Across our # 7-distro build matrix that fills instantly and forces re-downloads of # system + R packages every rebuild. The first rule below raises that tier. # # Limits are absolute (not %) on purpose: artemis and gaia have very # different free space (Hetzner ~42 GiB free vs Mac mini ~279 GiB), so a # percentage would mean wildly different real budgets. minFreeSpace = 20 GB # keeps the tight Hetzner host safe while staying modest on the Mac mini. [worker.oci] gc = true # Tier 1 — ephemeral caches (cache mounts, local context, git checkouts). # Raised from the 512 MB default to 8 GB, retained for 7 days so weekly # rebuilds reuse downloaded packages instead of re-fetching them. [[worker.oci.gcpolicy]] filters = [ "type==source.local", "type==exec.cachemount", "type==source.git.checkout", ] keepDuration = "168h" maxUsedSpace = "8GB" # Tier 2 — everything else (image layers, RUN exec results). Bounds the # whole buildkit cache and always leaves 20 GB free on the host disk. [[worker.oci.gcpolicy]] all = true reservedSpace = "2GB" maxUsedSpace = "40GB" minFreeSpace = "20GB"