fork() + unshare() == container

10 months ago
3

Taking things apart is the best way to figure out how they work. In this first breakdown, I go through the process of using fork to create a child process. Then, unshare is used to create a new PID namespace for the child process after which the child sees itself as PID 1.

code: https://github.com/g0t4/examples/blob/master/containers/ns/fork/fork.cpp

Loading comments...