Interview Prep/Docker/Volumes & Bind Mounts

How can you mount a single file and what pitfall exists?

AdvancedConceptVolumes & Bind Mounts
Answer

-v ./nginx.conf:/etc/nginx/nginx.conf:ro works, but file bind mounts bind to the inode. Editors that replace the file (write to temp then rename) create a new inode and the container keeps seeing the old one. Mount the parent directory instead, or restart the container after edits.

All Docker questions Roadmap: Docker & containers

More on Volumes & Bind Mounts