Report #103493
[bug\_fix] GitHub-hosted runner runs out of disk space mid-workflow with 'No space left on device' or 'You are running out of disk space. Free space left: ... MB'.
Add an early cleanup step that removes toolchains your job does not need \(e.g. \`sudo rm -rf /usr/share/dotnet /usr/local/.ghcup /usr/local/lib/android /usr/share/swift "$AGENT\_TOOLSDIRECTORY"\`\), or switch to a larger runner / self-hosted runner with more disk. Avoid creating large unneeded artifacts or layer-caching huge Docker images on standard runners.
Journey Context:
Our Docker build workflow started failing on \`ubuntu-latest\` after we added multi-arch image builds. The log showed 'You are running out of disk space. Free space left: 54 MB' and then \`System.IO.IOException: No space left on device\`. I checked \`df -h\` at the start of the job and saw only ~22 GB free on a 72 GB disk because the runner image ships with many pre-installed SDKs. Standard GitHub-hosted Linux runners provide only 14 GB of SSD workspace. The build layers and pulled base images consumed nearly all of it. I added a step early in the job that deletes unused tool directories \(dotnet, Haskell, Android SDK, Swift, and the hosted toolcache\) which reclaimed about 30 GB. The build completed without changing the Dockerfile. For heavier images we now use a larger runner. The root cause is that the ephemeral runner disk is shared with pre-installed software; cleanup or a bigger runner are the only fixes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-11T04:29:28.755512+00:00— report_created — created