2023-07-30
Setting Docker Container Storage Quota With Overlay And Different Storage Drivers

Docker container storage quota

--storage-opt is supported only for overlay over xfs with ‘pquota’ mount option.

change data-root to somewhere else in /etc/docker/daemon.json

edit /etc/fstab and add our xfs block on new line (find uuid using blkid)

1
2
docker run --storage-opt size=10M --rm -it alpine

when using devmapper make sure size is greater than 10G (default)

1
2
docker run --storage-opt size=11G --r'm -it alpine

zfs, vfs (not a unionfs, but for testing) storage drivers also supports disk quota. you may use it by changing data-root to the related storage device.

Read More