Let's talk about 
First, what is
? This is a software allowing you to build and share filesystem images. This is really useful to get a stable environment across a full team or even across runs for a build system.
When I use a tool, I always wonder "If I had to do it myself, how would I do it?". I don't thrive into the details inside my head, only the main lines, but this simple question help to know if there is some concepts underlying I don't known yet or if this is only a matter of implementation details.
Even if I'm sure I'm not always right, this rule of thumb allowed my to build a great tree of knowledge in my domain, espacially on topics I've never been teached about.
I never looked a the
source code but, if I had to do a simple version of it, I would plan something like that:
docker image =>find or build a filesystem allowing me to stack several layers of filesystem "diff"docker build =>use a chroot environment to build the layers of an image one by one-
docker run =>use a chroot environment to stack the layers of an image and give a prompt to the user or run a command -
docker push/pull =>create a system similar to git to organize and store the image layers based on their hashes
When running inside
,
uses the host kernel, it doesn't pop out a new one. That's why if your looking at the tasks running on your host, you will also see the ones launched inside the containers.
I don't know how it's managed on other platforms. Anyway, even if running on other platforms, this article content will stay true.