copy on write

A rule where a shared file is only copied at the moment someone changes it.

In more detail

When a container reads a file, the union filesystem serves it from the highest layer that has it. When the container writes to a file from a lower layer, the file is first copied up into the writable layer and the change lands on that copy. Deleting writes a marker instead of removing anything. This keeps containers fast to start and cheap to store.

Related terms

Taught in

References