github.com/ld86/docker@v1.7.1-rc3/docs/terms/layer.md (about) 1 <!--[metadata]> 2 +++ 3 draft = true 4 title = "Layers" 5 description = "Organizing the Docker Root File System" 6 keywords = ["containers, lxc, concepts, explanation, image, container"] 7 [menu.main] 8 parent = "mn_use_docker" 9 +++ 10 <![end-metadata]--> 11 12 # Layers 13 14 ## Introduction 15 16 In a traditional Linux boot, the kernel first mounts the root [*File 17 System*](/terms/filesystem) as read-only, checks its 18 integrity, and then switches the whole rootfs volume to read-write mode. 19 20 ## Layer 21 22 When Docker mounts the rootfs, it starts read-only, as in a traditional 23 Linux boot, but then, instead of changing the file system to read-write 24 mode, it takes advantage of a [union 25 mount](http://en.wikipedia.org/wiki/Union_mount) to add a read-write 26 file system *over* the read-only file system. In fact there may be 27 multiple read-only file systems stacked on top of each other. We think 28 of each one of these file systems as a **layer**. 29 30 ![](/terms/images/docker-filesystems-multilayer.png) 31 32 At first, the top read-write layer has nothing in it, but any time a 33 process creates a file, this happens in the top layer. And if something 34 needs to update an existing file in a lower layer, then the file gets 35 copied to the upper layer and changes go into the copy. The version of 36 the file on the lower layer cannot be seen by the applications anymore, 37 but it is there, unchanged. 38 39 ## Union File System 40 41 We call the union of the read-write layer and all the read-only layers a 42 **union file system**.