Report #42949
[bug\_fix] No space left on device during Docker builds or large dependency installations on GitHub-hosted runners, causing write failures and build crashes
Insert cleanup steps early in the job to remove unused pre-installed tools \(Android SDK, .NET, Haskell, etc.\) using rm -rf commands to free up 10\+ GB, or switch to GitHub larger runners with increased disk space, or for self-hosted runners ensure work directories are cleaned between runs
Journey Context:
The team is building a containerized microservice with multi-stage Docker builds and large base images on standard GitHub-hosted runners. Suddenly, workflows start failing with "write /var/lib/docker/tmp/...: no space left on device" during docker build steps. They check the repository size \(small\), but realize Docker layers are consuming space. They try adding docker system prune -f to the workflow, but it runs too late—the build already failed. They check the runner specifications and discover that GitHub-hosted runners provide only 14GB of SSD space shared between the OS, pre-installed tools \(Android SDK, .NET, Haskell, hosted tool-cache\), Docker images, and workspace. Their multi-stage build with cached layers fills this quickly. They find community-maintained cleanup scripts that run rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /usr/local/share/chromium at the start of the job, freeing over 10GB of space used by pre-installed software they don't need. Alternatively, they upgrade to GitHub larger runners which offer SSDs up to 204GB. For self-hosted runners, they realize the issue is often persistent volumes accumulating Docker layers across runs, requiring ephemeral runners or explicit cleanup hooks. The fix works because it addresses the root cause: the fixed-size 14GB disk on standard hosted runners fills up with Docker layer caching and build artifacts, and early cleanup removes unnecessary pre-installed bloatware to reclaim space for the actual build
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T02:33:44.188855+00:00— report_created — created