Interview Prep/Docker/Volumes & Bind Mounts

How do you share data between two containers?

IntermediateConceptVolumes & Bind Mounts
Answer

Mount the same named volume in both (-v shared:/data), or use --volumes-from other to inherit all its mounts. Ensure only one writer at a time for non-clustered data, otherwise you corrupt state (e.g., two Postgres instances on one volume).

All Docker questions Roadmap: Docker & containers

More on Volumes & Bind Mounts