Use a GitHub Actions runner with a larger disk space
From community channel:
I have a really big Dockerfile:
ERROR: failed to build: failed to solve: ResourceExhausted: failed to compute cache key: failed to > copy: write /var/lib/buildkit/runc-> overlayfs/content/ingest/d352575557ef1bb14551b2d1ddc4776a3b6aca8f9a7f9797cedb14d6cf44e368/data: no > space left on device
if RunsOn version >= 2.9, use the new volume label, and just set e.g. volume=120g in your runs-on: labels.
for all RunsOn versions, you can also use EC2 instances with a locally attached SSD instance storage (usually instances with a d in their name, e.g. m6id.large). If local disks are detected, /var/lib/docker will automatically be mounted on it. Local disks range from tens of gigabytes to terabytes.
finally, on larger memory instances you can use extras=tmpfs so that /var/lib/docker is mounted on a tmpfs volume. E.g. if you use instances with 128GB memory, you’ll get at least 100GB free for your builds. Also it should be faster as it skips the disk entirely.