How are layers shared between images?
AdvancedConceptImages, Layers & Storage Drivers
Answer
Layers are identified by content digest (diff_id/blob digest). Two images with the same base layers store them once on disk and in the registry, and a pull downloads only missing blobs. That is why putting stable instructions (base, system packages, dependencies) before frequently changing ones (app code) saves bandwidth and disk.
More on Images, Layers & Storage Drivers
What is a Docker image made of?BeginnerWhat is a layer and when is one created?BeginnerWhat is a union filesystem / OverlayFS?IntermediateWhat is copy-on-write (CoW) in containers?IntermediateWhy does deleting a file in a later `RUN` not shrink the image?IntermediateWhat storage drivers does Docker support and which is default?Intermediate