Home › Docker

no space left on device (Docker) — how to fix

failed to register layer: write /usr/lib/x86_64-linux-gnu/libLLVM.so: no space left on device

Quick fix: Run docker system df to see what's using space, then docker system prune (add -a to also remove unused images, --volumes for unused volumes) and docker builder prune.

What it means

The filesystem holding Docker's data (/var/lib/docker on Linux, a virtual disk on Docker Desktop) is full.

Step 1: see what's using space

docker system df

Step 2: clean up

docker container prune      # stopped containers
docker image prune -a       # images not used by any container
docker builder prune        # build cache (often the biggest)
docker volume prune         # unused volumes — check first, this deletes data!

Or all at once:

docker system prune -a

--volumes also removes unused volumes. Make sure no database you care about lives in one.

Step 3: check the host disk

df -h /var/lib/docker
sudo du -sh /var/lib/docker/*

Large container logs are a hidden culprit. Find them:

sudo du -sh /var/lib/docker/containers/*/*-json.log | sort -h | tail

Limit log size in /etc/docker/daemon.json and restart Docker:

{ "log-driver": "json-file", "log-opts": { "max-size": "10m", "max-file": "3" } }

Docker Desktop (macOS / Windows)

The virtual disk has a fixed maximum. After pruning, raise the limit in Settings → Resources → Disk image size if needed.

Inodes

If df -h shows free space but you still get the error, check inodes with df -i. Millions of small files in images or volumes can use them up; pruning helps here too.

Move Docker's data directory

If the root partition is small, put Docker on a bigger disk by setting "data-root": "/mnt/big/docker" in daemon.json, stop Docker, copy /var/lib/docker there, and start it again.

Last updated 2026-10-27.