Docker - setting the default size of images with device mapper storage driver

Been playing around with docker ( for a while now to see if it can help create a one script setup for setting up the build environment for the avr8 toolchain. One pesky problem when using the device mapper storage driver (the default on RHEL) is that the created images/containers are small - only 10G. That isn’t going to cut it for building the GNU toolchain - the gcc repo itself takes up 2.6G on my machine. Of course, mapping directories on the host would help, but I figured the more self contained the whole thing is, the better.

Googling for a solution only turned up this page[], but that isn’t really practical without the ability to commit the enlarged container. So I decided to check out the source (oh the joy of open source software :)) from github[] to see how to get around this. Turns out it is already documented - the device mapper driver’s[] says passing dm.basesize= should do the trick.

Had to delete the storage pool to get it to work though - I guess that’s because all images are snapshotted off a base device that is created only once. And the –storage-opts option for the docker daemon is not supported on older versions of docker (<= 0.7 IIRC) - all the more reason to upgrade to 1.0.

comments powered by Disqus