In Docker, an image is a stack of Read-only image layers. We also know that images share layers or other images. My question is about how this sharing mechanism work.
Does an image have pointers to the Docker storage driver or do they actually contain other layers? If the first one is true, does that mean Dockerfile saves those layers into daemon and the image is the instruction of retrieving those layers orderly?
It depends on your storage driver:
Now, on runtime:
The default driver are
aufs
, and theoverlay
andoverlay2
drivers.But Btrfs, ZFS, and other drivers handle the copy-on-write differently.
But in any case, the CoW remains key:
See more at "Select a storage driver".