Card 05/ 05

RecapDifficulty: Intermediate1 min

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.

What the topic established, and which card it was on
The ideaWhere
Writes land in the container's writable layer, never in the image, and last as long as the containerThe Writable Layer: Where a Container's Writes Go
Stopping and restarting keep the layer; docker rm deletes itWritable 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 doesBind Mounts vs Named Volumes
A mount replaces what the image had at that path, so mounting source over /app hides dependenciesMounting 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.