read the transcript!
different images have similar files
Rails container image and Django container image: we both use Ubuntu 18.04!
reusing layers saves disk space
exact same files on disk!
a layer is a directory
$ ls 8891378eb*
boot/lib/ opt sbin/ usr/ dev/lib64/proc/srv/var/
files in an ubuntu:18.04 layer
every layer has an ID
usually the ID is a sha256 hash of the layer’s contents
if a file is in 2 layers, you’ll see the version from the top layer
/code/file.py (this is the version you’ll see in the merged image)
by default, writes go to a temporary layer
temp layer (these files might be deleted after the container exits)
To keep your changes, write to a directory that’s mounted from outside the container