Interview Prep/Docker/Volumes, storage and data

Choosing between `--mount` and `-v`.

BeginnerScenarioVolumes, storage and data
Answer

Situation read → Both attach storage.

What I'd do → Prefer --mount type=volume,src=data,dst=/data,readonly: explicit key-value syntax, and it errors if a bind source path does not exist, whereas -v silently creates a root-owned directory.

Why → Fewer surprises and clearer reviews.

Interview tip → Compose long syntax mirrors --mount.

All Docker questions Roadmap: Docker & containers

More on Volumes, storage and data