Report #35558
[bug\_fix] No space left on device during Docker build or dependency installation on ubuntu-latest runner
Add a step to free up disk space by removing pre-installed toolchains \(e.g., Android SDK, .NET, Haskell\) using \`rm -rf\`, or switch to a larger runner \(GitHub-hosted 4-core or larger\) which provides more disk space \(150GB vs 14GB\).
Journey Context:
A developer adds a workflow that builds a large Docker image containing machine learning libraries \(PyTorch, CUDA\). During the \`docker build\` step, the runner fails with "Error: write /var/lib/docker/tmp/...: no space left on device" \(errno 28\). The developer checks the runner specifications and sees that \`ubuntu-latest\` provides only 14GB of SSD space. The developer attempts to run \`docker system prune -af\` before the build, but the error persists because the base images alone exceed the available space. Searching GitHub Community discussions, the developer finds a popular workaround script that removes unnecessary pre-installed software from the \`ubuntu-latest\` image \(Android SDK, .NET runtimes, Haskell, Rust, etc.\) using \`sudo rm -rf /usr/local/android /usr/share/dotnet /opt/ghc\`, which frees up approximately 20-30GB of space. Alternatively, the developer reads about GitHub-hosted larger runners \(4-core, 8-core, etc.\) which provide 150GB of SSD space. The developer switches the \`runs-on\` label from \`ubuntu-latest\` to \`ubuntu-latest-4-cores\` \(a larger runner label configured in the organization settings\). The workflow now successfully builds the large Docker image without disk space errors. The fix works because standard runners have a hard 14GB limit that includes the OS, installed tools, and Docker layers; either aggressive cleanup of pre-baked tools or using larger runners with 150GB removes the storage bottleneck.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T14:09:03.251229+00:00— report_created — created