Allow adding rules to cgroup devices.allow on container create/run#22563
Allow adding rules to cgroup devices.allow on container create/run#22563vdemeester merged 3 commits intomoby:mastermoby/moby:masterfrom
Conversation
23f775f to
cb30131
Compare
|
I agree with a feature, but naming is confusing I think. Maybe something like device-cgroup-rule? I dunno |
|
@LK4D4 I like the name, thanks! Will update shortly |
cb30131 to
87371c0
Compare
|
ping @LK4D4 ptal |
87371c0 to
02875c4
Compare
|
Added a test |
|
This seems super low-level (much more so than any other flag we have, I think). I don't understand the limitations on the devices cgroup, but... it seems like we should be able to address the use case with This could also be looked at along with security profiles... some profile option to enable host device update access. |
|
ping @tonistiigi , if I'm not wrong he was against a |
02875c4 to
5f1f192
Compare
5f1f192 to
a111a1e
Compare
a111a1e to
15ec21c
Compare
15ec21c to
deaa500
Compare
|
Design LGTM |
|
|
||
| ## Specify isolation technology for container (--isolation) | ||
|
|
||
| This option is useful in situations where you are running Docker containers on |
There was a problem hiding this comment.
oh, I see; moved to the other document
|
@mlaventure looks like you forgot to update the CLI reference with the example; #22563 (comment) |
|
ping @albers I had initially added a basic completion for bash (it's a very old PR), but I think you would do a better job, mind having a second look? Thanks! |
|
@mlaventure I don't think this can be improved because the argument contains a space. AFAIK, bash completion does not work inside quoted arguments. |
|
@albers thanks for checking! |
Allow adding rules to cgroup devices.allow on container create/run
|
Why not improving |
|
@hqhq what you suggest would require to spawn a goroutine to monitor changes to the filesystem and replicate it within the container. But that would also assume that the container has all the tools necessary for this (e.g. mknod) or force it to be there. Also, maybe the right of the device thus newly created would need to be changed within the container. It's easier to let people set up their own policy with the tool provided. |
|
|
|
@mlaventure |
|
@TH3MIS that what the option you're providing does. |
|
I think this feature is really helpful. |
- What I Did
This introduce a new
--device-cgroup-ruleflag that allow a user to addone or more entry to the container cgroup device
devices.allowThis should hopefully give a solution to issue like the one referred in the #22206 proposal:
- Note
I will make the required vendoring/engin-api PR once this has been accepted.
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)
Signed-off-by: Kenfe-Mickael Laventure mickael.laventure@gmail.com