The command docker run -v /data:/mydata -mode readonly ubuntu will not mount the
host’s /data1 directory to the ubuntu container in read-only mode. The commandhas several errors
that prevent it from working correctly. First, the host directory should be /data1 instead of /data, as
specified in the question. Second, the option flag should be --mode instead of -mode, and it should
be placed before the image name. Third, the mode value should be ro instead of readonly, as per the
Docker documentation1. The correct command should be docker run -v /data1:/mydata --mode ro
ubuntu, which will mount the host’s /data1 directory as a read-only volume at /mydata inside the
container1. Reference:
docker run | Docker Docs