Card 05/ 05
Recap: What Survives a Container
The writable layer, what removal destroys, and the two mounts that keep data, with where each was.
What survives a container comes down to the four ideas below, each listed with the card that covers it.
| The idea | Where |
|---|---|
| Writes land in the container's writable layer, never in the image, and last as long as the container | The Writable Layer: Where a Container's Writes Go |
Stopping and restarting keep the layer; docker rm deletes it | Writable Layer Example: A File That Does Not Survive docker rm |
| A bind mount when the host owns the files, a named volume when the container does | Bind Mounts vs Named Volumes |
A mount replaces what the image had at that path, so mounting source over /app hides dependencies | Mounting Over a Directory Hides the Image's Files |
The rule behind all four: treat the container as disposable, and decide for every directory that matters where it should live instead.
← → move through sections and cards