I am currently trying to create docker image with python files and lot of extra packages in requirement.txt.
While I am running the command "sudo docker build -t XXX ." the packages are downloaded and than installed one by one untill I receive an error: "Could not install packages due to an EnvironmentError: [Errno 28] No space left on device"
I have already did the atomic option of "sudo docker system prune" and all the past docker images are deleted.
Moreover, "sudo docker info" shows that I have 15 GB allocated to docker and while my unsuccesfull docker image size is 1 GB size it is still well below the total memory.
None of the options mentioned here: https://unix.stackexchange.com/questions/203168/docker-says-no-space-left-on-device-but-system-has-plenty-of-space or here: Docker error : no space left on device worked. I can create several "failed" dockers of ~1GB with the total size of more than 20GB so it is not an issue of lack of space on my HDD of VM. So I would be grateful for some more ideas.
If your system doesn't have Storage sense, you can use the Disk Cleanup tool to delete temporary files and system files from your device. In the search box on the taskbar, type disk cleanup, then select it from the results. Select the check box next to the type of files you want to delete.
What does it mean by not enough disk space? It means that the drive doesn't have storage and is full. That being said, the drive won't be able to save the larger files.
The disk partition used by Docker is becoming full during the build. You can see the available and used space on your partitions using df -h
. You can either add more space to that partition or you need to clean more files.
The docker system prune
only removes unused data (dangling images, unreferences volumes ...). You can clean more space, by deleting images that you don't need. I suggest you take a look at the images you have using docker image ls
and explicitly delete unneeded ones using docker image rm <image>
.
If you are using Docker Desktop on Mac, go to Preferences and increase the Disk image size. In my case it was displaying that it was full Disk image size: 59.6 GB (59.6 GB used)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With