I would like the ability to limit container size, however using the default storage driver aufs (for Ubuntu 14.04) I get an error when I try to use the --storage-opt arguments
$ docker create -it --name="disk_test" --storage-opt size=100G --cpuset-cpus="10,11,12,13,14,15,16,17" -m=16G ubuntu:14.04
Unable to find image 'ubuntu:14.04' locally
14.04: Pulling from library/ubuntu
04c996abc244: Pull complete
d394d3da86fe: Pull complete
bac77aae22d4: Pull complete
b48b86b78e97: Pull complete
09b3dd842bf5: Pull complete
Digest: sha256:bd00486535fd3ab00463b0572d94a62715cb790e482d5419c9179cd22c74520b
Status: Downloaded newer image for ubuntu:14.04
Error response from daemon: --storage-opt is not supported for aufs
When I use devicemanager as my storage-driver it works. Is my only option to choose something other than aufs if I want to limit my container root file system size?
--storage-opt size=X
is available when running on devicemapper, zfs and btrfs in Docker 1.12, possibly on windows as well.
The option is not currently available for aufs or overlay/2 storage drivers.
It looks like overlay2 on XFS will get support in Docker 1.13-1.14. Ext4 support will follow some time after as it has a dependency on updates to a newer kernel than most distros currently use (4.5+).
aufs may not get the feature as Docker seems to be pushing towards having overlay2 as the default as 4+ kernels have built in support for overlay.