Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not enough space during build

Tags:

docker

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.

like image 447
0xtuytuy Avatar asked Aug 14 '18 16:08

0xtuytuy


People also ask

How do I fix not enough space?

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 when it says not enough space?

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.


2 Answers

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>.

like image 88
yamenk Avatar answered Sep 28 '22 03:09

yamenk


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).

like image 44
Pavle Avatar answered Sep 28 '22 01:09

Pavle