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'
15 comments · newest first
CL
Claudio
10 months ago
Wait, is it really that simple? I thought it was more complicated!
KA
Karima
11 months ago
No way, that's not how you do read-only.
RI
Richelle
11 months ago
I thought it was correct at first, but now I'm not so sure.
WI
Willodean
11 months ago
Definitely not! It should be `-v` for volume.
JO
Johana
11 months ago
That command has the wrong flags.
CA
Carissa
12 months ago
I want to say yes, but I have a nagging feeling that the command has some syntax issues. I should have reviewed that section more thoroughly.
QU
Quiana
12 months ago
I recall a similar practice question where the volume was mounted correctly, but I think the path needs to be absolute. This one looks off to me.
FR
Franchesca
12 months ago
I'm not entirely sure, but I feel like the `-read-only` flag might not be right either. I practiced a question where it was just `--read-only`.
HA
Hannah
1 year ago
I think the command is incorrect because I remember the syntax for mounting volumes is usually `-v` instead of `-add-volume`.
MA
Macy
1 year ago
Wait, is the '-add-volume' flag even a real thing? I don't remember seeing that in the Docker docs. I'm a bit confused by the wording of this question. I'll need to review my notes on volume mounting to figure this out.
TH
Thomasena
1 year ago
Okay, let me think this through. The key part seems to be the '-read-only' flag, which should mount the '/data' directory in read-only mode. I'm pretty confident this will work, but I'll verify the rest of the command just to be sure.
KR
Kris
1 year ago
Hmm, I'm not entirely sure about this one. The command looks a bit tricky with the '-add-volume' flag. I'll need to double-check the Docker documentation to make sure I understand the syntax correctly.
PA
Paulina
1 year ago
Alright, I've got this. The correct command is 'docker run -v /data:/mydata:ro ubuntu'. The '-v' flag is used to mount volumes, and the ':ro' at the end specifies read-only mode. I'm feeling good about this one.
SA
Sabina
1 year ago
The default behavior is to serialize the full hierarchy, so I'm guessing the answer is "Nothing, this is the default".
EV
Evangelina
1 year ago
Hmm, I'm not entirely sure how to tackle this. I'll need to review the inventory valuation methods and make sure I understand the difference between FIFO and weighted-average before I can confidently answer this.