Do you mean disk storage space used by the container? You set the size
property on the disk device. If you’re doing this in the profile (so the same limit is applied to multiple containers):
devices:
...
root:
path: /
pool: default
type: disk
size: 3GiB
However, I believe the quota enforcement only works on zfs or btrfs storage pools. See this thread.
I’ve just tested it with incus and zfs, and it works as expected: inside the container, df
reports the expected disk size, and trying to write beyond this gives a “Disk quota exceeded” error.
Of course, zfs does compression too. You might end up being able to write more than 3GiB, while still using less than 3GiB of disk. (So if you’re testing with dd
, use /dev/urandom
not /dev/zero
as the source of data)