ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 136 - DCA discussion

Report
Export

Will this command mount the host's '/data1 directory to the ubuntu container in read-only mode?

Solution. 'docker run -v /data:/mydata -mode readonly ubuntu'

A.

Yes

Answers
A.

Yes

B.

No

Answers
B.

No

Suggested answer: B

Explanation:

The commanddocker run -v /data:/mydata -mode readonly ubuntuwill not mount the host's/data1directory to the ubuntu container in read-only mode. The command has several errors that prevent it from working correctly. First, the host directory should be/data1instead of/data, as specified in the question. Second, the option flag should be--modeinstead of-mode, and it should be placed before the image name.Third, the mode value should beroinstead ofreadonly, as per the Docker documentation1.The correct command should bedocker run -v /data1:/mydata --mode ro ubuntu, which will mount the host's/data1directory as a read-only volume at/mydatainside the container1.Reference:

docker run | Docker Docs

asked 08/11/2024
aaron black
34 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first