-
Notifications
You must be signed in to change notification settings - Fork 18.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 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. |
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 don't think that is a sufficient argument. By that token, we wouldn't have cross-platform functionalities on the first place right? Let me elaborate: I understand and respect that this may require exta abstraction, and that this may look ugly etc. But I specifically mean the idea of "underlying storage supporting a generic tech". Cheers! |
@andres-fr I'm not sure what you are getting at. For instance, with xfs you need the |
@cpuguy83 TLDR: I think I'm at the wrong issue, sorry for the noise. To give more context, I was under the impression that this issue was about allowing the Docker host to have a disk usage limit (e.g. something in the form images+containers+volumes <= 100GB). After some searching I came to the conclusion that this functionality is not provided by Docker, and that the reason you provide is backend heterogeneity. Maybe at this point I dare to ask, do you know if this is this possible now? |
Docker will not impose such a limit. |
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.
The text was updated successfully, but these errors were encountered: