LOGBOOK

HELP

Quiz Entry - updated: 2026.12.01

Why does a container need extra storage for persistent data, and what are the three storage options Docker offers?

A container's own filesystem disappears when the container is removed; volumes (Docker-managed), bind mounts (any host folder) and tmpfs mounts (RAM, never persistent) keep data outside it.

By default everything a container writes goes into its writable layer, which is deleted together with the container. A database whose container crashes and is recreated would start empty. Data that must survive therefore lives outside the container:

Type Where the data lives Persistent? Key property
Volume /var/lib/docker/volumes/<name>/_data, managed by Docker Yes Only Docker processes (and users in root/docker) can get at it; can be listed, inspected, shared, backed up
Bind mount Any existing host path, such as ~/dockerlab Yes Not managed by Docker; host and container see the same files live, both can change them
tmpfs mount Host memory (RAM) No: gone when the container stops Very fast; nothing touches the disk, which also suits sensitive data such as secrets

Rule of thumb: volumes for application data in production (databases), bind mounts for development (edit code on the host, run it in the container) or to inject a config file, tmpfs for scratch data or secrets that must not hit the disk.

Storage options: bind mount to any host path and volume in Docker's area on disk are persistent; tmpfs in memory is gone on stop

* Bind mount and volume on disk, tmpfs in RAM. *

Go deeper:

From Quiz: ISLAB / Docker Introduction | Updated: Dec 01, 2026