On my Debian 7 machine, Docker fails when creating an image with the error:
System error: write /sys/fs/cgroup/docker/.../cgroup.procs: no space left on device
I tried removing containers and images, which freed some space but didn’t fully solve the issue.
How can I increase memory or configure Docker to avoid this? Where are the relevant Docker no space left on device settings stored, and what’s the best way to clean up or manage storage?
Sometimes freeing containers isn’t enough because Docker uses /var/lib/docker for storage.
On Debian 7, the default storage driver (overlay or aufs) can fill your root partition.
Check disk usage:
df -h /var/lib/docker
If /var/lib/docker is full, you can move Docker’s data directory:
# Stop Docker first
sudo systemctl stop docker
# Move data
sudo mv /var/lib/docker /mnt/bigdrive/docker
# Create symlink
sudo ln -s /mnt/bigdrive/docker /var/lib/docker
# Restart Docker
sudo systemctl start docker
This is super effective when the root partition is small but you have a bigger drive.
Hey! I’ve run into this exact issue
. Docker often fills up disk space with stopped containers, dangling images, and unused volumes. I usually clean up like this:
# Remove stopped containers
docker container prune
# Remove dangling images
docker image prune
# Remove unused volumes
docker volume prune
# Or everything at once
docker system prune -a --volumes
This often recovers a lot of space.
I always double-check what will be deleted, docker system df is handy to see disk usage.
Another reason for “no space left on device” can be huge container logs or memory cgroup limits:
Limit container logs in /etc/docker/daemon.json:
{
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3"
}
}
Restart Docker after editing:
sudo systemctl restart docker
I also check memory/cgroup usage if you see /sys/fs/cgroup/docker/... errors, sometimes old cgroups aren’t released. Restarting Docker and cleaning stopped containers usually fixes it.