Docker container specific disk quota

Ningappa picture Ningappa · Jul 23, 2016 · Viewed 8.9k times · Source

Every Docker container will be configured with 10 GB disk space by default, which is the default configuration of devicemapper and it works for all containers. how can I limit inodes or disk quota to the individual container?

For example :

container #1 with disk 10GB and 10000 Inode value

container #2 with disk 20GB and 100000 Inode value

Note : I understand that we can change Default value 10GB by using docker -d--storage-opt but this applied to each and every containter.

Question : how can I limit inodes or disk quota to the individual container?

Answer

johnharris85 picture johnharris85 · Jul 23, 2016

As of 1.12 this is supported for dm, btrfs and zfs. The syntax is:

$ docker create -it --storage-opt size=120G fedora /bin/bash

Note that the size must (obviously) be above whatever you have set in your daemon opts.

Relevant docs link.