docker run --mount type=bind,source=/host/path,target=/container/path,readonly myimage
Mount a host directory read-only
Binds the host directory into the container but read-only, so the container cannot modify host files. Add the readonly option to any --mount type. Prevents accidental writes from misbehaving containers.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.