How do containers work? 🤔 📦
There are 3 fundamental Linux technologies that software like @Docker use behind the scenes to work their magic.
Namespaces, control groups, and union filesystems.
Let's explore these features!
There are 3 fundamental Linux technologies that software like @Docker use behind the scenes to work their magic.
Namespaces, control groups, and union filesystems.
Let's explore these features!
Setting up a User namespace enables a user ID for processes within the namespace to map to different user IDs outside the namespace.
This is important to help prevent a root user inside of a container from having root privileges outside of the container (if an attacker escaped)
This is important to help prevent a root user inside of a container from having root privileges outside of the container (if an attacker escaped)
Because container images are comprised of these layers it enables huge efficiency gains by sharing and caching common layers to minimize the amount of data that needs to be transmitted and stored.
The lower layers can be shared while the upper layers are unique!
The lower layers can be shared while the upper layers are unique!
Using these 3 technologies, we could create our own container implementation by:
1) Start with an archive containing the necessary dependencies
2) Create some namespaces and cgroups
2) Running our process within those namespaces/cgroups
Or we can just use "docker run" 😅
1) Start with an archive containing the necessary dependencies
2) Create some namespaces and cgroups
2) Running our process within those namespaces/cgroups
Or we can just use "docker run" 😅
Some additional resources for further reading on these topics:
- jvns.ca (@b0rk)
- martinheinz.dev (@Martin_Heinz_)
- youtube.com (@joshva_jebaraj)
- jvns.ca (@b0rk)
- martinheinz.dev (@Martin_Heinz_)
- youtube.com (@joshva_jebaraj)
Hopefully, this thread helped you understand containers a bit better!
This content is adapted from a portion of my upcoming FREE course on Docker + containers.
Check out (and ⭐️) the repo and follow
@sidpalas
to be notified when the course is released!
github.com
This content is adapted from a portion of my upcoming FREE course on Docker + containers.
Check out (and ⭐️) the repo and follow
@sidpalas
to be notified when the course is released!
github.com
Loading suggestions...