Interview Prep/Docker/Volumes & Bind Mounts

Volume vs bind mount: when do you pick which?

BeginnerConceptVolumes & Bind Mounts
Answer

Volumes for databases and any data Docker should own (backups via docker volume, works the same on Linux/Mac/Windows, copies image content on first mount). Bind mounts for source code hot-reload, host config files and sockets. Bind mounts expose host paths and permissions to the container, so use :ro whenever possible.

All Docker questions Roadmap: Docker & containers

More on Volumes & Bind Mounts