- Newest
- Most votes
- Most comments
Hello, Edgar.
The error message no space left on device indicates that Docker has run out of disk space while trying to build your image. This is a common issue when Docker's storage, typically located in /var/lib/docker, becomes full with images, containers, volumes, or build cache. Here are steps to resolve the issue:
-
Check Disk Usage Verify if the disk is full using the command:
df -h
-
Cleanup Unused Docker Resources To free up space, remove unused Docker objects:
docker system prune
For a more thorough cleanup (including volumes):
docker system prune -a --volumes
-
- Remove Specific Docker Images
List all images:
docker images
- Remove Specific Docker Images
List all images:
Remove unneeded images:
docker rmi [IMAGE_ID]
Replace [IMAGE_ID] with the actual image ID.
-
Increase Disk Space Consider increasing the disk space for Docker's storage partition, if necessary.
-
Move Docker's Storage Location If needed, change Docker's storage directory by editing /etc/docker/daemon.json:
{ "data-root": "/path/to/new/docker/data" }
Replace /path/to/new/docker/data with the directory path you want to use that has free space.
Then, restart Docker:
sudo systemctl restart docker
Please accept this answer. Otherwise, please let me know for us to troubleshoot.
Regards, Pablo Silva
Relevant content
- asked 8 months ago
- Accepted Answerasked 2 years ago
- asked 4 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 4 months ago