$ docker run -it --rm -v /:/mnt:rprivate alpine
docker: Error response from daemon: invalid mount config: must use either propagation mode "rslave" or "rshared" when mount source is within the daemon root, daemon root: "/var/lib/docker", bind mount source: "/", propagation: "rprivate".
See 'docker run --help'.
This can be an issue when Docker/Moby supports "recursively read-only" (RRO) mounts:
Description
Docker/Moby does not accept
rprivatepropagation when the mount source contains the daemon root (/var/lib/docker) :This can be an issue when Docker/Moby supports "recursively read-only" (RRO) mounts:
So I'd suggest introducing an mount option for forcibly enabling
rprivatepropagatione.g.,
docker run -v /:/mnt:rro,rprivate-forceOr
docker run --mount type=bind,src=/,dst=/mnt,rro,bind-propagation=rprivate,bind-propagation-force=true