How can I decrease Base Device Size of Docker Containers?

I want to create containers smaller than the standard 10GB and i did not see anyone doing this, only increasing the base device size beyond 10GB.

I’ve seen some pages quoting that’s impossible, but there is a page of red hat forum (https://access.redhat.com/solutions/3117171) which i dont have acess that do this, can somebody help me?

Het @akiles185
you can use opt --storage-opt to set the size which cannot be less than default base size(10 gb)
but there some condition where you can do that. Please read below link.

And also if you want that docker don’t set 10gb of size for each container. You can use device mapper docker storage which is thin provision. So that means it will set the container size to 10gb virtually means it expand the actuall size of container as per requir time the base limit.

1 Like

Choose a different base image. I don’t know where you got the idea that an image for Linux would be anything like 10GB, if you are finding that you have images of that size you really need to take a long hard look at what you are building. If you want to get extreme, start with the ‘scratch’ base image, if you want a slightly easier time of it, start with alpine or an image based on alpine. Also keep in mind that docker uses image caching so size isn’t necessarily a big deal from a disk space perspective and iro container start up, although there is some impact, it’s not especially significant in the bigger perspective of a distributed system.