-
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
Updating a containers DeviceCgroupRules not working #42255
Comments
I did some more investigation using Docker 20.10.6 and cgroupv2 using the systemd driver. Also in this combination updating device cgroups seems not to work. What I noticed is that Docker/containerd seems to duplicate the eBPF programs whenever a container update is executed:
I guess that a new eBPF program gets created is expected, a bit unexpected that the old eBPF program still exists. Seems to be an entirely different bug. But even the new eBPF program still has the same device restrictions. Investigating a bit further revealed that the Docker daemon does not pass new device restrictions to containerd (in It seems that libcontainerdtypes.Resources does support device restrictions. But even when passing device restrictions it seems that containerd (currently) does not update the eBPF filters. So I guess this is a containerd limitation then? The fact that containerd recreates the eBPF device filter programs on update seems to indicate that most of the infrastructure to adjust cgroup device restrictions dynamically is already present. @AkihiroSuda maybe you have some pointers for me? |
runc does not support updating devices for cgroup2 |
Yes, update only update some fields of container.Resource struct, doesn't include DeviceCgroupRules and other Device fields. moby/container/container_unix.go Line 278 in 7b9275c
|
Now with opencontainers/runc#2366 addressed by opencontainers/runc#2951, and release 1.0.0 released this should be one step closer. Is 20.10 going to use runc 1.0.0? From what I understand |
Description
The Docker Engine API documents
DeviceCgroupRules
as possible properties in the payload to update a container. However, the Device CGroup rules do not get updated accordingly.Steps to reproduce the issue:
Describe the results you received:
No updated Device CGroup Rules (empty list)
Describe the results you expected:
The new list of Device CGroup as specified in the update API request.
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
Same behavior with Docker 19.03.15.
The text was updated successfully, but these errors were encountered: