Docker No Space Left on Device Fix

Docker can fill disks with images, build cache, stopped containers, volumes and logs. Check usage before deleting data.

Symptoms

  • Builds fail with no space left on device.
  • Containers cannot write files.
  • Disk looks full after repeated compose builds.

Likely causes

  • Unused images or build cache consume disk.
  • Container logs grow without rotation.
  • Named volumes hold database or app data.

Fix steps

  1. Run docker system df to inspect usage.
  2. Prune unused build cache and images carefully.
  3. Review volumes before deleting anything that may contain data.

Verify the fix

  • Check df -h and df -i.
  • Run docker system df after cleanup.
  • Restart the affected container and watch logs.

FAQ

Is docker system prune safe?

It can delete unused resources. Review flags and volumes before running destructive cleanup.

Can logs fill the disk?

Yes. Configure log rotation for long-running containers.

Related tools and guides

Last updated: May 18, 2026