Report #87617
[bug\_fix] Runner runs out of disk space during Docker build or large artifact generation
Free up disk space by removing unused pre-installed software \(Android SDK, .NET, Haskell, CodeQL, etc.\) using the community action \`jlumbroso/free-disk-space@main\` or manual \`rm -rf\` commands targeting \`/usr/share/dotnet\`, \`/opt/ghc\`, \`/usr/local/lib/android\`, etc. Alternatively, optimize the build \(use docker buildx with cache export/import rather than local storage, or clean up layers\), or switch to GitHub-hosted larger runners \(paid tier\) or self-hosted runners with larger disks. The root cause is that GitHub-hosted \`ubuntu-latest\` runners provide approximately 14-22 GB of SSD, which is quickly consumed by large Docker layers, node\_modules, or build artifacts.
Journey Context:
A developer is containerizing a machine learning application. The Docker image is based on \`python:3.9-slim\` but installs PyTorch, CUDA libraries, and scientific computing packages, resulting in a 7GB image. The GitHub Actions workflow checks out the code, sets up Docker Buildx, and runs \`docker build -t myapp:latest .\`. Halfway through the build \(during the layer writing phase\), the job fails with 'ERROR: failed to solve: failed to register layer: write /var/lib/docker/overlay2/.../usr/local/lib/python3.9/dist-packages/torch/lib/libtorch\_cuda.so: no space left on device'. The developer checks the GitHub-hosted runner documentation and sees that \`ubuntu-latest\` has limited disk space \(~14GB\). They try to optimize the Dockerfile by combining RUN layers, but the base image requirements are still too large. They search the GitHub Community forums for 'no space left on device actions' and find a highly-starred solution using the \`jlumbroso/free-disk-space@main\` action. They add this as the very first step in their job, configured to remove Android SDK, .NET, Haskell, and CodeQL. This frees up approximately 8GB of disk space. On the next run, the Docker build completes successfully with room to spare.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T05:39:01.082357+00:00— report_created — created