Building a Linux Container Using Namespaces: Part – 1 (2020)

by Arteiiion 4/12/2024, 2:22 AMwith 21 comments

by ofey404on 4/12/2024, 3:10 AM

Obviously, there is a part 2:

https://www.polarsparc.com/xhtml/Containers-2.html

by asicspon 4/12/2024, 3:17 AM

See also:

* The What, Why and How of Containers (https://www.annwan.me/computers/what-why-how-containers/)

* Containers from Scratch (https://ericchiang.github.io/post/containers-from-scratch/)

* Linux Containers From Scratch in C (https://www.lucavall.in/blog/barco-linux-containers-from-scr...)

* Life of a Container (https://indradhanush.github.io/blog/life-of-a-container/)

by tyingqon 4/12/2024, 3:09 PM

You can get a sort of "reader's digest" version of this by having a look at "bocker". It's about 120 lines of bash that implements the important bits of docker using nsenter, btrfs, cgcreate, etc.

https://github.com/p8952/bocker/blob/master/bocker

by zhengiszenon 4/12/2024, 1:27 PM

I guess cgroups come as version 2 https://www.redhat.com/en/blog/world-domination-cgroups-rhel...

by benhoffon 4/12/2024, 2:23 PM

If you were looking to create testing for networking, i.e., simulating network dropouts for a client-server connections, is this something that you can use namespaces for, or would virtual machines be more fit for purpose?

by WhatIsDukkhaon 4/12/2024, 4:49 PM

This looks to be using cgroups v1 and should be updated to v2 as its not directly compatible and would improve things understanding wise.

by begueradjon 4/12/2024, 7:05 AM

This is what I used as a university student. Pretty effective. But I guess the author did not share his opinion about them.

by shivshivshivon 4/14/2024, 1:01 PM

What's the difference between chroot and the mount namespace type?

by mperhamon 4/12/2024, 3:24 AM

Based on Ubuntu 18.04, which is pretty old now. Are there any relevant changes for 22.04 or 24.04 or is this stuff stable now?

by bdd8f1df777bon 4/12/2024, 3:43 AM

A side note: the page does not declare utf-8 encoding. I have manually change it to resolve some of garbled text.