Interview Prep/Docker/Volumes, storage and data

Configuration files need to update without rebuilding the image.

BeginnerScenarioVolumes, storage and data
Answer

Situation read → Config is separate from code.

What I'd do → Mount it read-only: -v $PWD/nginx.conf:/etc/nginx/nginx.conf:ro, or in Compose use configs:. Reload without restart: docker exec web nginx -s reload.

Why → Same image, different behaviour, and a simple rollback of config.

Interview tip → Single-file bind mounts break on editors that replace the inode (vim); mount the directory.

All Docker questions Roadmap: Docker & containers

More on Volumes, storage and data