whiteout file
A marker in a higher layer that says a file from a lower layer has been deleted.
In more detail
Layers can only add, never remove, so deletion is recorded as a special whiteout entry. The original bytes stay in the lower layer and anyone who pulls the image can extract them. That is why removing a password in a later Dockerfile instruction does not remove it from the image.
Related terms
- copy on write — A rule where a shared file is only copied at the moment someone changes it.
- layer — One read-only slice of an image that records the files a single build step added, changed or deleted.
- secret — Any value that grants access, such as a password, access token or private key, and must be kept out of code and version control.
- build secret — A password or token given to one build step without being saved in any image layer.
Taught in
- Union Filesystems, Images And Writable Layers — Docker Architecture & Production Containers