Lesson 12 / 28

Containers Are Ephemeral

See why container filesystems are ephemeral and why data written inside is lost 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 moves to the next container
  • It is copied to Docker Hub
  • It's permanently lost
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.