What is the problem you're trying to solve
When configuring containerd with the state directory set to a non-default value, containerd still creates files in /run/containerd. This occurs because /run/containerd is hard-coded in utils.RuncRoot.
Describe the solution you'd like
Clients can specify an alternate runc root directory through Options, but it would be nice to have a client-independent behavior.
We have hard-coded sockets under /run/containerd/s, so creating files under /run/containerd is inevitable even with #5097
True. The difference with the sockets at /run/containerd/s compared to the directories and files created for runc are that the socket paths incorporate the daemon socket address in the hash function while the runc path is strictly namespace + ID. The effect of that means that if you run two containerd daemons with different state directories, you can still end up creating conflicts if you try to run containers with the same (namespace, ID) pair in the separate daemons.
Most helpful comment
True. The difference with the sockets at
/run/containerd/scompared to the directories and files created for runc are that the socket paths incorporate the daemon socket address in the hash function while the runc path is strictly namespace + ID. The effect of that means that if you run two containerd daemons with differentstatedirectories, you can still end up creating conflicts if you try to run containers with the same (namespace, ID) pair in the separate daemons.