
Ask HN: Good resources on learning how docker works under the hood? - mohitmun
I&#x27;m using docker since a week now and I&#x27;m fascinated by it. Wanted to learn how it works under the hood.
======
chatmasta
Start with namespaces and cgroups. Once you realize that docker is basically a
management interface over those, everything will click.

I’m trying to find a really good blog from years ago but having trouble. This
looks good though: [https://ericchiang.github.io/post/containers-from-
scratch/](https://ericchiang.github.io/post/containers-from-scratch/)

~~~
jenscow
and chroot, too.

~~~
unmole
Docker uses pivot_root and not chroot, IIRC.

------
hardwaresofton
Super late to this thread but the best video I've ever seen on how
docker/containers work is this one:

Jessica Frazelle's (docker core maintainer) talk on how to build containers in
pure bash and C: [http://containersummit.io/events/nyc-2016/videos/building-
co...](http://containersummit.io/events/nyc-2016/videos/building-containers-
in-pure-bash-and-c)

There's also this one, which is similar:
[https://www.youtube.com/watch?v=HPuvDm8IC-4&t=1103s](https://www.youtube.com/watch?v=HPuvDm8IC-4&t=1103s)

------
rubenbe
I would recommend you to read the LWN series on namespaces. The articles are
not very recent, but this low level part of docker (kernel namespaces) has not
changed.

[https://lwn.net/Articles/531114/](https://lwn.net/Articles/531114/)

------
pacuna
For a start I would recommend to listen to this podcast:

[http://www.se-radio.net/2015/01/episode-217-james-
turnbull-o...](http://www.se-radio.net/2015/01/episode-217-james-turnbull-on-
docker/)

And then for a more technical and practical view I would recommend this
course:

[http://shop.oreilly.com/product/0636920051350.do](http://shop.oreilly.com/product/0636920051350.do)

------
rajathagasthya
I watched these SysAdmin Casts when learning Docker. Follow the links provided
in the transcript for more in-depth stuff.

[https://sysadmincasts.com/episodes/31-introduction-to-
docker](https://sysadmincasts.com/episodes/31-introduction-to-docker)

[https://sysadmincasts.com/episodes/24-introduction-to-
contai...](https://sysadmincasts.com/episodes/24-introduction-to-containers-
on-linux-using-lxc)

[https://sysadmincasts.com/episodes/14-introduction-to-
linux-...](https://sysadmincasts.com/episodes/14-introduction-to-linux-
control-groups-cgroups)

------
antoncohen
Jérôme Petazzoni's talk on cgroups, namespaces, etc. I think he has given the
talk a bunch of times, I saw it in person once, here is a video I found:

[https://www.youtube.com/watch?v=sK5i-N34im8](https://www.youtube.com/watch?v=sK5i-N34im8)

He goes into cgroups, namespaces, etc. Then does a demo where is manually does
what docker does, like untars an image, creates namespaces, creates the
networking.

------
tyingq
Docker in ~100 lines of bash:
[https://github.com/p8952/bocker](https://github.com/p8952/bocker)

You'll see it is mostly gymnastics with cgroups, btrfs, pivot_root, and some
networking commands.

Docker is neat, but it's just using functionality that's already there.

------
vinn124
if youre a week in, youll find this helpful.

[https://jvns.ca/blog/2016/10/10/what-even-is-a-
container/](https://jvns.ca/blog/2016/10/10/what-even-is-a-container/)

------
kanishkdudeja
This video by Ben Corrie is an excellent expanation for what a container
actually is.

[https://www.youtube.com/watch?v=EnJ7qX9fkcU](https://www.youtube.com/watch?v=EnJ7qX9fkcU)

------
atsaloli
[https://github.com/fatherlinux/container-internals-
lab](https://github.com/fatherlinux/container-internals-lab)

------
billconan
[https://blog.lizzie.io/linux-containers-
in-500-loc.html](https://blog.lizzie.io/linux-containers-in-500-loc.html)

------
vcoisne
check out [http://training.play-with-docker.com/](http://training.play-with-
docker.com/)

~~~
nopit
Not really under the hood.

