Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd quota support for storage backends #3804
Comments
|
This feature is going to be added at some point, but not right away. It's a bit more difficult to add this functionality right now because a lot of chunks of code are moving from one place to another. After this work is done, it should be much easier to implement this functionality. Please keep in mind that quota support can't be added as a hack to devicemapper, it has to be implemented for as many storage backends as possible, so it has to be implemented in a way which makes it easy to add quota support for other storage backends. While I do understand that you need quota support for the container itself, wouldn't using bind mounts with quota help until quota support gets added to Docker? |
|
Right now I'm using the fixed ext4 image size as a quota replacement but for this to work well I depend on #3548 being implemented. If I wanted to hack quota support into my docker clone, where could I change the mount arguments? |
|
I've updated the title to make it more generic. We have more backends now and it wouldn't make sense to "hack" quota support into a specific backend. |
|
Is there any updates to this problem? |
|
Is there any way for docker to use BTRFS instead of AUFS? |
|
@mtasic85 yes, format your dive on btrfs and docker will use it automatically. or use the flag when starting the daemon |
|
@crosbymichael Thanks. Is there way to know or specify CONTAINER ID before it is created? I'm asking because I want to create btrfs subvolume with quota and mount it to containers working dir. |
|
Is there any progress concerning quota support ? I don't see any news since @itsnotvalid question |
|
Since BTRFS support was added, you should be able to manually add quotas (see btrfs wiki page). However, I didn't try it myself. |
|
yeah but I guess even device-mapper should support as it uses ext4/xfs as a filesystem. What I was looking for was a way to tell docker to apply it on the fly without having to find sub volumes (for Btrfs) after the creation of a new container |
|
I implemented btrfs quota support here: majst01/docker@docker:master...master So review and comments welcome. For the long term i would like to have per container quotas. It should be possible to limit disk space the same way cpushares and memory is limited. But this would be a start. |
|
@majst01 .. +1, so much!! |
|
@majst01 Any updates on the btrfs quota support? Very interested in this feature. |
|
@majst01 Any updates on the btrfs quota support? Very interested in this feature. +1 |
|
Any updates? Seems nothing changed at all? |
|
Any updates? |
1 similar comment
|
Any updates? |
|
ok now ? |
|
USER POLL The best way to get notified when there are changes in this discussion is by clicking the Subscribe button in the top right. The people listed below have appreciated your meaningfull discussion with a random +1: |
|
@cpuguy83 features you listed here is not related with disk space quota... |
|
They are not "disk quota support", but they are related to the topic. |
|
So, it's not possible to use Disk Quotas inside a contanier for now? |
|
@arkkanoid correct |
|
And is there another way to limit the disk size for an specific user inside docker container? |
|
The solution I ended up using, which is far from perfect but gets the job done, is to make a virtual, limited-size file system loop-mounted on the host, and then mount it as a volume on the container. This page has a good tutorial on setting up limited-size filesystems (the quota reporting mechanisms are optional): http://souptonuts.sourceforge.net/quota_tutorial.html One downside of this approach is that you need to have root permissions in order to mount the loop filesystem. (That's not really a problem though because you also need root permissions to control Docker. This obviously works only if you have control of the host machine. |
|
@vote539 This is essentially what the Friends Don't Let Friends Run Docker on Loopback in Production If this is just for dev, then stop reading now. You have a solution that works, just go with it. If it's for prod, then you will probably get better performance from using:
You should also consider if |
|
Basically the solution for the Docker disk limit stuck at 20gb would be to share the growing file directory to the host system? https://docs.docker.com/compose/compose-file/#volumes-volume-driver
|
|
@gegre You should store your data in a volume. That part you've definitely got right. The rest isn't good practice, and seems completely unrelated to the topic of this issue. AFAIK, the only Docker storage backend which limits container disk by default is Volumes use flat storage rather than layered storage, and use a completely different backend which can be extended via plugins. Simply making You do not need to map it to the host filesystem as you're suggesting - this is a pre-1.9 way of doing things, and was discouraged even then in favour of data only containers. Now that named volumes exist, you should use them for your data instead. |
|
FYI, quotas are now supported in devicemapper, zfs, and btrfs. |
|
Although disk quota is supported by ext4, but at most of time the user running in the container is root, it is not limited by disk quota |
|
@cpuguy83 do you have links to any information on this? |
|
@treeder Looks like docs are not ready for that yet, though there is some mention in Basically, can set |
|
This is closed but I'm not sure if it works for our requirements. Are there issues about supporting ext4, aufs or overlayfs? Which version of docker daemon has merged the patch and we can start to use? |
|
I think it isn’t working yet. I haven’t read that this feature already tobe notifications@github.com ezt írta (időpont: 2016. aug. 25., Cs 5:50):
|
|
@tobegit3hub @kovacsa91 |
|
Thanks @kovacsa91 and @AkihiroSuda . That's clear to me now --- Update --- Refer to docs/reference/commandline/run.md, we can use And after diving into the code, the |
|
@AkihiroSuda What is --storage-opt size=xxx means for the various storage drivers?. Is 'xxx' means just the max size of the writable(CoW) layer in the container or the sum total of the container base image layers plus the writable(CoW) layer?. It's not clear to me. Also, what this "disk quota" field in the container.HostConfig?. How it is related to --storage-opt size=XXX ? |
|
if I use devicemapper /aufs /overlay ...,all support storage-opt size? |
|
This is not supported for
The issue should be re-opened. |
|
Any updates on this issue? |
|
I get this error:
Im quite surpised that setting a max on file storage is not supported by docker. |
|
@geertschuring Setting quotas is highly dependent on the underlying filesystem. Quotas are support on btrfs, overlay2+xfs, and and devicemapper. |
|
The issue indeed should be re-opened.
|
|
@samip5 unless there is some generic tech to target, then no. |
|
@cpuguy83 To my understanding, ext4 is supposed to support quotas, so why is it not supported by Docker? |
|
Seems like you are looking for #29364
Brian Goff
… On Feb 16, 2019, at 09:09, Sami Mäntysaari ***@***.***> wrote:
@cpuguy83 To my understanding, ext4 is supposed to support quotas, so why is it not supported by Docker?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I understand that the aufs does not support quotas but since the device mapper backend mounts an ext4 partition it should be possible to enable quota support there. If the loopback device with the ext4 partition is mounted with the proper quota options I think it would be possible to use regular linux quota tools inside of a docker container.