Skip to content
Latchkey

Docker "failed to register layer: no space left on device" in CI

The daemon ran out of disk while unpacking a pulled image layer. failed to register layer: ... no space left on device happens during extraction - the data partition backing /var/lib/docker is full.

What this error means

A docker pull / docker run / FROM fails with failed to register layer: write /var/lib/docker/...: no space left on device. Freeing disk or pruning images lets the pull complete.

docker
failed to register layer: write /var/lib/docker/overlay2/abc123/diff/usr/lib/.../libX.so:
no space left on device

Common causes

The Docker data partition is full

Accumulated images, containers, and build cache fill /var/lib/docker, so extracting a new layer has nowhere to write.

Large base images on a small runner disk

A big image pulled onto a runner with limited disk exhausts space during extraction.

Leftover build cache and dangling images

Stale build cache and dangling layers occupy space that the new pull needs.

How to fix it

Prune images and build cache before pulling

Reclaim space so the layer can be extracted.

Terminal
docker system df
docker system prune -af --volumes
docker builder prune -af
docker pull node:20-slim

Give the daemon more disk or a bigger data root

Point data-root at a larger volume or use a larger runner.

daemon.json / Terminal
# /etc/docker/daemon.json
{ "data-root": "/mnt/docker" }

sudo systemctl restart docker

How to prevent it

  • Prune images and build cache between jobs on shared runners.
  • Size the runner disk for your largest base images.
  • Point data-root at a generous volume on busy builders.

Frequently asked questions

What causes ""failed to register layer: no space left""?
Accumulated images, containers, and build cache fill /var/lib/docker, so extracting a new layer has nowhere to write.
How do I fix "failed to register layer: no space left"?
Reclaim space so the layer can be extracted.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card