Skip to content
Latchkey

Skaffold build "no space left on device" in CI

A Skaffold build writes image layers, cache, and context to the runner disk. When that disk fills, the underlying builder fails with "no space left on device" partway through, which Skaffold surfaces as a build failure.

What this error means

A build stops with "write ...: no space left on device" or "failed to copy: no space left on device" during a Docker or kaniko build stage.

skaffold
building [my-app]: docker build failed: write /var/lib/docker/tmp/...: no space left on device

Common causes

Accumulated layers and cache fill the disk

Large base images, multiple artifacts, and leftover build cache exhaust the runner's limited disk.

A bloated build context

A context that includes large files not excluded by .dockerignore is copied into the daemon and consumes space.

How to fix it

Free disk before the build

  1. Prune unused Docker data at the start of the job.
  2. Shrink the build context with a tight .dockerignore.
  3. Re-run the build with more headroom.
Terminal
docker system prune -af --volumes
df -h

Reduce what the build writes

Use smaller base images and multi-stage builds so fewer layers are written, and exclude large paths from the context.

.dockerignore
# .dockerignore
node_modules
*.log
dist

How to prevent it

  • Prune Docker data before large builds in CI.
  • Keep .dockerignore tight so the context stays small.
  • Prefer multi-stage builds and slim base images.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →