Does anyone know of a way to do network isolation on macOS?
Does anyone know of a good, accessible primer on Linux namespaces? I’ve been using Docker for years, and I have a conceptual understanding of what namespaces do, but I have no idea what the primitives are or how they work. In particular, this post thoroughly confused me as it seemed to be alternating back and forth between processes and threads as the operand of namespaces. I’m also confused about the “if we have a process, we can just create the namespace in /proc/self, but we don’t have one, so we create it in /var/run/… and then bind mount it into /proc/self” (I don’t see why we need to bind mount instead of writing directly to /proc/self/…).
Hi! Sorry for a slow reply; I was in transit. And sorry also to have caused you more confusion. Two key points:
For reading about namespaces, the single best place to start is namespaces(7). It explains what /proc/self is all about and also explains why the bind mounting matters.
For reading about threads versus processes, I found Eli Bendersky’s article to be a good overview.
Do let me know if those notes are a help – and thanks for the feedback! I’m not yet sure how to help clarify things in my own article, but hopefully this is a start.