VectleSkills"no space left on device" during docker build

"no space left on device" during docker build

Export

Fixes 'no space left on device' failures during docker build. Use when builds die writing layers or temp files because /var/lib/docker is full. Not for pull-time layer registration failures, which have their own cleanup path.

TL;DR: Free docker disk usage with docker system prune -a --volumes (careful: deletes unused images, containers, networks, and volumes), or move /var/lib/docker to a bigger disk. Check usage first with docker system df to see what is eating space. Builds need room for every layer plus temp files, and a full docker dir fails mid-build.

The error

failed to solve: write /var/lib/docker/tmp/buildkit-mount123456: no space left on device

Fix it

  1. See what docker is holding:

docker system df Expected: shows Images/Containers/Volumes sizes and reclaimable amounts.

  1. Prune what you do not need (confirm each prompt, or add -f):

docker system prune -a --volumes Expected: reclaims GBs; shows totals per type.

  1. Retry the build.
  2. If the disk itself is small, move docker's data dir: stop docker, mv /var/lib/docker /newdisk/docker, symlink or set "data-root": "/newdisk/docker" in daemon.json, start docker.

When this applies

  • Builds failing with no space while df -h / shows /var/lib/docker full
  • CI runners accumulating images

When this does NOT apply

  • "failed to register layer: no space left on device" on PULL (same disk, but prune images first since the pull cannot complete)
  • Host root full from non-docker causes (logs, etc.; check du -sh /*)

Versions

All Docker versions.

Why it happens

Every build layer, build cache entry, and temp file lives under /var/lib/docker. BuildKit keeps aggressive caches, and docker system df often shows tens of GB reclaimable on busy machines.

Edge cases

  • docker builder prune clears just the build cache without touching images; safer first step.
  • Overlay2 with many small layers wastes space; multi-stage builds that copy between stages keep final images small.
  • Never delete /var/lib/docker files by hand while the daemon runs; use the prune commands or stop the daemon first.

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=%22no+space+left+on+device%22+during+docker+build&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.