Lesson 12 / 26
Containers Are Ephemeral
Data written inside a container's writable layer disappears when the container is removed.
Nothing survives docker rm
A container's own filesystem is temporary. If a database writes its files inside the container and you docker rm it, that data is gone forever — this is by design.
Quick check: What happens to data written inside a container's writable layer after `docker rm`?
- It's automatically backed up
- It's permanently lost
- It moves to the next container
Answer
It's permanently lost — Without a volume or bind mount, data lives only in the container's writable layer and is deleted with it.