Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

LPI Exam 305-300 Topic 1 Question 33 Discussion

Actual exam question for LPI's 305-300 exam
Question #: 33
Topic #: 1
[All 305-300 Questions]

If a Dockerfile contains the following lines:

WORKDIR /

RUN cd /tmp

RUN echo test > test

where is the file test located?

Show Suggested Answer Hide Answer
Suggested Answer: C

Contribute your Thoughts:

Chan
1 months ago
I'm going with /root/tesc. You know, because that's how I roll - always thinking outside the box! Gotta keep the exam graders on their toes, am I right?
upvoted 0 times
...
Keena
1 months ago
Definitely /tmp/test. The WORKDIR / command sets the root directory, but the RUN cd /tmp command changes the working directory to /tmp before creating the file. This one's a classic Docker gotcha!
upvoted 0 times
...
Johnetta
1 months ago
Hah, this is a tricky one! I bet the file is in /test. The WORKDIR / command sets the root directory, and the RUN echo test > test command creates the file right there in the root.
upvoted 0 times
Jimmie
11 days ago
Yeah, it can be a bit confusing with Dockerfile commands sometimes.
upvoted 0 times
...
Stevie
12 days ago
Oh, I see. That makes sense now.
upvoted 0 times
...
Kris
13 days ago
Oh, I see. I got confused with the WORKDIR command.
upvoted 0 times
...
Kaitlyn
16 days ago
No, it's actually in /tmp/test on the system running docker build.
upvoted 0 times
...
Alishia
17 days ago
I think the file test is in /test.
upvoted 0 times
...
Leigha
18 days ago
No, it's actually in /tmp/test on the system running docker build.
upvoted 0 times
...
Jess
19 days ago
I think the file is in /test as well.
upvoted 0 times
...
...
Effie
1 months ago
I'm pretty sure the file is in /tmp/test. The WORKDIR / command sets the working directory to the root, but the RUN cd /tmp command changes it to /tmp before creating the test file.
upvoted 0 times
Mona
28 days ago
D) /tmp/test on the system running docker build.
upvoted 0 times
...
Maryln
1 months ago
A) /ting/test within the container image.
upvoted 0 times
...
...
Sarina
2 months ago
Hmm, I see your point. But I still think it's in /tmp/test because of the RUN cd /tmp command.
upvoted 0 times
...
Tiffiny
2 months ago
I disagree, I believe the file test is located in /test within the container image.
upvoted 0 times
...
Sarina
2 months ago
I think the file test is located in /tmp/test.
upvoted 0 times
...
Armando
2 months ago
The file test should be located in the /tmp directory within the container image. The RUN cd /tmp command changes the working directory to /tmp before the echo test > test command is executed.
upvoted 0 times
Hershel
1 months ago
D) /tmp/test on the system running docker build.
upvoted 0 times
...
Angelo
1 months ago
C) /test within the container image.
upvoted 0 times
...
Blossom
1 months ago
B) /root/tesc within the container image.
upvoted 0 times
...
Nelida
2 months ago
A) /ting/test within the container image.
upvoted 0 times
...
...

Save Cancel