Report #101024
[bug\_fix] GitHub-hosted runner fails mid-build with 'No space left on device' or the warning 'You are running out of disk space. Free space left: ...'.
Reclaim space by deleting pre-installed tools and caches your build does not need \(for example \`sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/hostedtoolcache\` on Ubuntu\), or use a community action like \`jlumbroso/free-disk-space\` or \`FirelightFlagboy/gh-runner-free-disk-space\`. For persistent needs, switch to a larger runner or a self-hosted runner with a bigger volume.
Journey Context:
A Docker build in my workflow started failing at the layer-write step with 'No space left on device'. I added \`df -h\` to the start and end of the job and saw free space drop from ~20 GB to under 500 MB during the build. The culprit was a multi-GB base image plus large build caches, combined with the pre-installed Android SDK, .NET, and hosted tool cache that GitHub includes on \`ubuntu-latest\`. I first tried \`docker system prune\`, which helped a little. The reliable fix was a dedicated cleanup step at the very beginning that removes the tool directories my job does not use, freeing roughly 10–20 GB. For a smaller project this is enough; for a project that genuinely needs more space the proper path is a larger runner rather than fighting the hosted image.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-06T04:51:37.527085+00:00— report_created — created