Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You don't need init in each container, and the encouraged model of having a whole distro in a container is bonkers. Play around with clone(2)/unshare(2) directly, and it is fairly simple. All you need to know about pid 1 is if it terminates your namespace goes, and orphan processes will reparent to it (and some signals are blocked). If you have a single process then this doesn't matter really. You can do all this from Python I expect, I have done it all from Lua with no issues.


OK from what I understand "LXC" is basically the user space tools that give you the distro in the container... it's more of a VM model.

But yeah I think I just need the underlying cgroups, and possibly some of the namespaces. Although I don't car aell that much if untrusted code can see what processes are running; just as long as it can't affect them.

Just curious what you were using containers for from Lua? Sounds interesting.


I started using them largely for testing netlink code, as it is much easier to create some isolated network devices than risk messing about with the real ones. This is part of a fairly comprehensive Linux binding for Lua https://github.com/justincormack/ljsyscall




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: