Report #35288
[bug\_fix] No space left on device during Docker build or package installation on GitHub-hosted runners
Free up disk space by removing large pre-installed toolchains \(Android SDK, .NET, Haskell, CodeQL\) using \`rm -rf\` commands at the start of the job, and/or run \`docker system prune -af\` to clean up dangling images and build cache between steps.
Journey Context:
The developer's workflow builds a large Docker image or installs heavy Conda environments. It suddenly starts failing on the \`docker build\` step or during \`apt-get install\` with the error "No space left on device" \(ENOSPC\). The developer checks the GitHub-hosted runner documentation and sees they only have 14GB of SSD space. They realize that the pre-installed software on the ubuntu-latest image \(Android SDK, .NET runtimes, Haskell GHC, etc.\) consumes over 10GB of that space. The developer initially tries adding \`docker system prune\` at the end of the job, but the failure happens during the build, not after. They find a popular community issue on the runner-images repository where users share a cleanup script that deletes the large unused tool directories at the start of the job: \`sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL\`. After adding this cleanup step as the very first step in the job, the available space increases to over 30GB, and the Docker build completes successfully.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T13:41:58.149250+00:00— report_created — created