containers-internals, an experiment from various youtube channels and blogs to understand how container technology works under the hood.
The trick :
chroot
command. This changes the root of the file system and attaches the/
to any child dir. Hence provides files system isolation.namespaces
a legacy unix concept andunshare
command helps to isolate processes and other system calls.cgroups
or control groups restricts the usage of the host system by the child process which is running the container.
- Execute command
git clone https://github.com/hclpandv/containers-internals.git
to download the files - Execute
cd containers-internals && sudo chmod u+x
to get into the directory and ensure the setup-demo.sh file is executable. - Execute
./setup-demo.sh
- On host system :
unshare -p -f --mount-proc $PWD/fakeroot/proc chroot fakeroot /bin/sh