Interview Prep/Docker/Volumes & Bind Mounts

What are the three ways to persist or share data with a container?

BeginnerConceptVolumes & Bind Mounts
Answer
  • Volume: managed by Docker under /var/lib/docker/volumes, portable, driver-pluggable. Preferred for persistent data.
  • Bind mount: maps a host path into the container; depends on host layout. Good for dev and config.
  • tmpfs: in-memory, never written to disk, gone when the container stops.
All Docker questions Roadmap: Docker & containers

More on Volumes & Bind Mounts