Will this command mount the host's '/data* directory to the ubuntu container in read-only mode?
Solution. 'docker run -add-volume /data /mydata -read-only ubuntu'
This command does not mount the host's /data directory to the ubuntu container in read-only mode. The --add-volume and --read-only flags do not exist and will cause an error. To mount a host directory or a named volume to a container, you need to use the -v or --volume flag. To mount the host's /data directory to the ubuntu container in read-only mode, you need to use -v /data:/mydata:ro instead. Reference: https://docs.docker.com/storage/bind-mounts/, https://docs.docker.com/engine/reference/run/#volume-shared-filesystems
Limited Time Offer
25%
Off
Currently there are no comments in this discussion, be the first to comment!
Currently there are no comments in this discussion, be the first to comment!