Copy-on-write (CoW) preserves shared container image files until an application changes one. The filesystem combines read-only image layers with a private read/write layer. section 2.1.2
Changing a shared file
Containers A and B can read the same image-layer files. If A changes a file, Docker copies the entire file into A’s read/write layer and changes that copy, so B remains unaffected. Deleting a file marks it deleted above the lower layer rather than removing it from the image. section 2.1.2
Account for these operational consequences:
- Changing permissions or ownership also copies the entire file, so modifying large or numerous files can significantly increase writable-layer usage. section 2.1.2
- Each container has its own writable layer, which isolates changes even when containers share image layers. section 2.1.2
Figure 2.8 Containers can share image layers.
Use the layer diagram to trace how containers share image data while retaining separate writable changes. section 2.1.2




