3 ms·
I'd guess that the gap you're missing is that one of the namespace types containers use is a mount namespace. During container setup, you get a new mount names
by tene 5y ago
I'd guess that the gap you're missing is that one of the namespace types containers use is a mount namespace.
During container setup, you get a new mount namespace so that any changes to mounted filesystems are only seen by processes sharing that new mount namespace. Then you mount the filesystem from the docker image, replacing the filesystems mounted in the root namespace.
I don't know if it'll help, but that process is very similar to what happens during boot, where you've initially got a root filesystem mounted from the initrd, but you replace it with the root filesystem from a disk after you've loaded the right drivers from the initrd.
- anyonecancode 5y agoYes, that is definitely one of the gaps I had, thank you (also the other replies to my comment -- upvoted all of you). I'm generally on a Mac (which runs docker in a linux VM -- the reason why is much clearer now) and so my exposure to linux is mostly in the context of ssh-ing into a server. I think the fact that OS X is linux-like without actually being a linux distro also subtly led me astray, as I've been thinking of different distros in the same way I think of OS X as different from Windows, and not really thinking about the "userland" vs "kernel" distinction.