Earthly "no space left on device" (BuildKit cache) in CI
BuildKit stores layers and its build cache on disk. On a CI runner with a small volume, the cache plus intermediate layers can exhaust the disk mid-build, and the failing step reports "no space left on device".
What this error means
A RUN step or an export fails with "write ...: no space left on device" or "failed to solve: ... no space left on device" partway through an otherwise valid build.
earthly
+build | error: failed to copy files: write /var/lib/buildkit/... : no space left on device
Error: solve: failed to solve: no space left on deviceCommon causes
The BuildKit cache grew past the disk
Cached layers accumulate across runs on a persistent daemon and are never pruned, filling the volume buildkitd writes to.
Large intermediate layers on a small runner
A hosted runner ships a modest disk; big base images and build outputs can exhaust it in a single run.
How to fix it
Prune the BuildKit cache
Reclaim space by pruning Earthly's cache before or between builds.
Terminal
earthly prune --allFree disk and cap the cache
- Remove unused preinstalled tooling to reclaim runner space.
- Set a cache size limit so buildkitd evicts old layers.
- Prune between jobs on long-lived self-hosted daemons.
Terminal
# limit the buildkit cache Earthly keeps
export EARTHLY_BUILDKIT_CACHE_SIZE_MB=20000
earthly pruneHow to prevent it
- Cap the BuildKit cache size so it self-evicts.
- Prune the cache on persistent self-hosted daemons.
- Use runners with enough disk for your base images.
Related guides
Earthly "could not connect to buildkitd" in CIFix Earthly "could not connect to buildkitd" in CI - Earthly needs a running BuildKit daemon, and the CI job…
Dagger cache volume "no space left on device" in CIFix Dagger "no space left on device" in CI - the engine cache and cache volumes filled the runner disk. Prune…
Earthly OOM / killed under high parallelism in CIFix Earthly builds killed by OOM under high parallelism in CI - buildkitd runs many targets at once and exhau…