How to increase the size limit of a docker container?


6 days ago


15 time


Context: I'm under Archlinux, and wanted to create a dockerfile as a reference for users of my program under Ubuntu 16.04 (xenial). It only has an old OpenCV version (2.4) on apt, so I need to compile OpenCV from sources.

Problem: OpenCV compilation creates more than 10G of data, which is the container size limit (visible with df -h), and thus crashes before finishing compilation.

Last failed attempt: I saw that there is a daemon option --storage-opt dm.basesize=20G. So I changed the docker.service line:

# from
ExecStart=/usr/bin/dockerd -H fd://
# to
ExecStart=/usr/bin/dockerd --storage-opt dm.basesize=20G -H fd://

After restarting the daemon service, and pruning all my images and containers, the command docker info now shows "Base Device Size: 21.47GB" instead of some 10GB previously. However, every new container still have a size limit of 10G. The command df -h shows:

[email protected]:/# df -h
Filesystem                                                                                       Size  Used Avail Use% Mounted on
/dev/mapper/docker-8:6-1704110-b5a7ec35a707f478a4a836ff859108092bbe32525d558d4f6661efba91313801   10G  139M  9.9G   2% /

Any idea of how I can change this?

0 answers