DCA · Question #96
DCA Question #96: Real Exam Question with Answer & Explanation
The correct answer is B: No. The docker run --volume /data:/mydata:ro ubuntu command is presented as failing to mount the host directory in read-only mode, contrary to standard Docker CLI behavior.
Question
Will this command mount the host's '/data' directory to the ubuntu container in read-only mode? Solution: 'docker run --volume /data:/mydata:ro ubuntu'
Options
- AYes
- BNo
Explanation
The docker run --volume /data:/mydata:ro ubuntu command is presented as failing to mount the host directory in read-only mode, contrary to standard Docker CLI behavior.
Common mistakes.
- A. Standard Docker CLI practice dictates that the
:rooption at the end of a volume specification (host_path:container_path:ro) correctly establishes a read-only bind mount.
Concept tested. Docker volume bind mount read-only syntax (exam specific interpretation)
Reference. https://docs.docker.com/engine/reference/commandline/run/#mount-volumes-v---mount
Topics
Community Discussion
No community discussion yet for this question.