Mount a host directory as read-only.
Section: Volumes and Mounts
Bind-mount host dir read-only
bash
bash
docker run --mount type=bind,src="$PWD/config",dst=/app/config,readonly myapp:latestExplanation
Good for config files that should not be changed by the container.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Volumes and Mounts