4 ms·
To understand Docker [0] in a complete way you first have to understand a lot of other concepts. You need to understand what "linux containers" [1] are. To und
by peterwwillis 13y ago
To understand Docker [0] in a complete way you first have to understand a lot of other concepts.
You need to understand what "linux containers" [1] are. To understand that you need to understand cgroups [2]. To understand cgroups you have to understand process groups/sessions [3] and namespace isolation [4], as well as how the kernel implements cgroups. [5] [6]
You need to understand what chroot [7] is. (it just prepends a path to all pathname lookups for a process and its children)
You need to understand what aufs [8] [9] is. To help understand aufs, you need to understand how union filesystems [10] work, how copy-on-write [11] works, and how virtual filesystems work [12] [13] [14].
You need to understand what rsync is [15]. To understand that you need to understand delta compression [16], and how rolling checksums [17] are used.
You should also understand things like how bash works, how processes signal each other and return status on exit, how file descriptors (like stdin/stdout/stderr) work, and other basic UNIXy concepts, to understand how other parts of docker works.
Docker is a frankenstein amalgamation of all these things, working together to allow you to basically run an arbitrary command in a way that is as isolated from your operating system as is practical while still remaining "light weight". Other solutions have other benefits or tradeoffs as evidenced here [18].
[0] http://www.activestate.com/blog/2013/06/solomon-hykes-explains-docker http://www.activestate.com/blog/2013/06/solomon-hykes-explai...
[1] https://en.wikipedia.org/wiki/LXC https://en.wikipedia.org/wiki/LXC
[2] http://blog.dotcloud.com/kernel-secrets-from-the-paas-garage-part-24-c http://blog.dotcloud.com/kernel-secrets-from-the-paas-garage...
[3] https://en.wikipedia.org/wiki/Process_group https://en.wikipedia.org/wiki/Process_group
[4] https://en.wikipedia.org/wiki/Namespace_isolation#NAMESPACE-ISOLATION https://en.wikipedia.org/wiki/Namespace_isolation#NAMESPACE-...
[5] https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt
[6] http://blog.dotcloud.com/under-the-hood-linux-kernels-on-dotcloud-part http://blog.dotcloud.com/under-the-hood-linux-kernels-on-dot...
[7] https://lwn.net/Articles/252794/ https://lwn.net/Articles/252794/
[8] http://aufs.sourceforge.net/aufs.html http://aufs.sourceforge.net/aufs.html
[9] http://blog.dotcloud.com/kernel-secrets-from-the-paas-garage-part-34-a http://blog.dotcloud.com/kernel-secrets-from-the-paas-garage...
[10] https://en.wikipedia.org/wiki/Union_filesystem https://en.wikipedia.org/wiki/Union_filesystem
[11] https://en.wikipedia.org/wiki/Copy-on-write https://en.wikipedia.org/wiki/Copy-on-write
[12] https://en.wikipedia.org/wiki/Virtual_file_system https://en.wikipedia.org/wiki/Virtual_file_system
[13] http://lwn.net/Articles/57369/ http://lwn.net/Articles/57369/
[14] http://www.win.tue.nl/~aeb/linux/lk/lk-8.html http://www.win.tue.nl/~aeb/linux/lk/lk-8.html
[15] https://rsync.samba.org/how-rsync-works.html https://rsync.samba.org/how-rsync-works.html
[16] https://en.wikipedia.org/wiki/Delta_encoding https://en.wikipedia.org/wiki/Delta_encoding
[17] https://en.wikipedia.org/wiki/Rolling_hash https://en.wikipedia.org/wiki/Rolling_hash
[18] https://en.wikipedia.org/wiki/Operating_system-level_virtualization#Implementations https://en.wikipedia.org/wiki/Operating_system-level_virtual...