Report #6460
[bug\_fix] No space left on device during Docker build or package installation on ubuntu-latest runners
Free up disk space by removing unnecessary pre-installed toolchains \(Android SDK, .NET, Haskell, CodeQL\) at the start of the workflow using \`sudo rm -rf\` commands, or switch to GitHub-hosted larger runners with increased disk space \(2x or 4x sizes\), or optimize the Docker build to use multi-stage builds with smaller final images.
Journey Context:
A developer was containerizing a machine learning application requiring PyTorch and CUDA libraries. The workflow built a Docker image using \`docker/build-push-action\`. During the \`RUN pip install\` step, the build failed with 'No space left on device'. The developer added a debug step \`run: df -h\` and saw the root filesystem was 100% full. Checking the GitHub documentation, they discovered that standard GitHub-hosted runners only provide approximately 14GB of SSD space, and the pre-installed software \(Android SDK, multiple .NET versions, Haskell toolchain\) consumes a significant portion of this. The developer initially tried \`docker system prune\` but it wasn't enough. The working solution involved adding a step at the very beginning of the job to aggressively remove unnecessary pre-installed directories: \`sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/share/boost /opt/hostedtoolcache/CodeQL /usr/local/lib/android /mnt\`. This freed up over 20GB of space, allowing the Docker build to complete successfully.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T00:11:20.285897+00:00— report_created — created