November 2017
Intermediate to advanced
298 pages
7h 10m
English
Another type of a bind mount that we did not really cover earlier is a read-only bind mount. This configuration is used when the data mounted into the container needs to remain read-only, which is very useful when passing configuration files into multiple containers from the host. This form of mounting a volume looks a bit like this for both of the two syntax styles:
$ # Old-style$ docker run <run_params> \ -v /path/on/host:/path/on/container:ro \ <image>...$ # New-style$ docker run <run_params> \ --mount source=/path/on/host,target=/path/on/container,readonly \ <image>...
As mentioned a bit earlier, something that a read-only volume can provide us as opposed to a regular mount is passing configuration files to the containers ...
Read now
Unlock full access