0

I'm am trying to assign Cgroup created in host to a process in Docker container by mounting /sys/fs/cgroup/cpuset/examplegroup/, but getting following error when running container as root.

Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/sys/fs/cgroup/cpuset/examplegroup/cgroup.procs" to rootfs at "/sys/fs/cgroup/cpuset/examplegroup/cgroup.procs": mkdir /var/lib/docker/overlay2/3ed1e0a34b47170dfd30d92921849303aad9bb1e89aaaaa79e89949a4549f11b/merged/sys/fs/cgroup/cpuset: read-only file system: unknown.

Need to use cgroup from host system only. When I tried with privileged mode, did not see above error but following command throws no such file error when running inside container. echo $$ > /sys/fs/cgroup/cpuset/examplegroup/cgroup.procs no such file or directory

It didn't mount with privileged mode.I am new to cgroups and not sure how to achieve this. Please help me if there is any simpler way to assign cgroup created in host system a process running in container.

  • Can you give a little more details on what you're trying to do, and why you need this specific cgroup assignment? I'm not an expert in this area but I believe Docker itself uses cgroups as a core part of the container mechanism, so you may not be able to manually use cgroups yourself without interfering with Docker here. – David Maze Mar 20 '23 at 10:40

0 Answers0