News for hackers. Stuff that matters.
Re:Linux Container Internals by kragniz on Monday June 05, 2017 @12:29PM (#14488913)
Writing the basics of a container runtime is easier than it sounds. Last summer I was curious how they work and wrote something simple in python that can run docker images:

https://github.com/kragniz/omochabako/blob/master/omochabako

https://asciinema.org/a/77296?speed=2&autoplay=true

I learned a lot doing this, and I'd recommend it to anyone who's interested about containers.

Re:Linux Container Internals by pooktrain on Monday June 05, 2017 @06:43PM (#14492949)
Thanks for sharing!

When you set out to do this, had you studied docker's source code at all? Or did you just have a basic understanding of containers? Other than the link from OP, are there any resources you'd recommend to get one to the point where you have enough understanding of the concepts without having to "cheat" and look at the docker implementation?

I want to do this too, but it's not as much fun if you need to go to the source due to not understanding the fundamentals.

Re:Linux Container Internals by kragniz on Monday June 05, 2017 @08:38PM (#14493741)
I started with a basic understanding about the parts involved, but not so much how they fit together. Most of the necessary information came from the lwn series of articles posted in another comment: https://lwn.net/Articles/531114/

The actual namespace stuff was easy, the harder part was pivoting the root fs and figuring out all the things to mount. At some point I looked at the source for systemd-nspawn, but I forget exactly what for.

Re:Linux Container Internals by bogomipz on Monday June 05, 2017 @08:32PM (#14493710)
Thanks for the links. What was your starting point the Docker/Golang source?
Re:Linux Container Internals by kragniz on Monday June 05, 2017 @08:40PM (#14493755)
I avoided looking at docker/runc as a starting point since that would spoil the fun of trying to figure it out from first principles. I looked at systemd-nspawn when I was stuck adding mounts.
Re:Linux Container Internals by bogomipz on Tuesday June 06, 2017 @08:27AM (#14496666)
Thanks, any other references you would recommend?