Interview Prep/Docker/Containers, VMs & Isolation Internals

What does a container's `/proc/1/cgroup` or `/proc/self/cgroup` tell you?

AdvancedConceptContainers, VMs & Isolation Internals
Answer

It shows which cgroup the process belongs to. On cgroup v2 with a private cgroup namespace it prints 0::/, while on the host you would see 0::/system.slice/docker-<id>.scope. Tools use this to detect containers and to find limits, but apps must read memory.max rather than /proc/meminfo, which still shows host memory.

All Docker questions Roadmap: Docker & containers

More on Containers, VMs & Isolation Internals