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 701-100 Topic 11 Question 54 Discussion

Actual exam question for LPI's 701-100 exam
Question #: 54
Topic #: 11
[All 701-100 Questions]

Given the following excerpt of a Dockerfile:

Run apt-get --y update && apt-get install --y fortunes && apt-get clean

Why are the multiple apt-get commands combined in one RUN statement instead of using multiple RUN statements?

Show Suggested Answer Hide Answer
Suggested Answer: D

Contribute your Thoughts:

Adolph
29 days ago
I bet the folks who wrote this question are just waiting for someone to say 'apt-get install fortune-cookies' as the answer. That would be a real knee-slapper!
upvoted 0 times
Kris
4 days ago
C) To avoid the creation of unnecessary images because Docker creates a new image for each RUN statement.
upvoted 0 times
...
Glory
8 days ago
B) To ensure the execution order of the commands because Docker might evaluate the statements of a Dockerfile in any order.
upvoted 0 times
...
...
Celeste
2 months ago
Alright, let's see here. I think the key is understanding how Docker handles RUN statements and image layers. Time to put on my thinking cap!
upvoted 0 times
Rolland
1 months ago
E) To execute the apt-get install command only if the apt-get update command was successful because Docker does not check the success of RUN statements.
upvoted 0 times
...
Bettina
1 months ago
C) To avoid the creation of unnecessary images because Docker creates a new image for each RUN statement.
upvoted 0 times
...
Nelida
1 months ago
B) To ensure the execution order of the commands because Docker might evaluate the statements of a Dockerfile in any order.
upvoted 0 times
...
...
Francoise
2 months ago
Hmm, this is a good one. I wonder if the folks who wrote this question have a sense of humor. Maybe they'll throw in a joke about 'apt-get install fortune-cookies' or something.
upvoted 0 times
...
Roxanne
2 months ago
But wouldn't combining the commands in one RUN statement reduce the number of images created?
upvoted 0 times
...
Yasuko
2 months ago
Haha, I bet the folks who wrote this question were trying to trip us up. But I'm pretty sure the right answer has something to do with efficiency and avoiding unnecessary image layers.
upvoted 0 times
Marylin
16 days ago
C) To avoid the creation of unnecessary images because Docker creates a new image for each RUN statement.
upvoted 0 times
...
Tandra
17 days ago
B) To ensure the execution order of the commands because Docker might evaluate the statements of a Dockerfile in any order.
upvoted 0 times
...
Roxane
20 days ago
C) To avoid the creation of unnecessary images because Docker creates a new image for each RUN statement.
upvoted 0 times
...
Halina
23 days ago
B) To ensure the execution order of the commands because Docker might evaluate the statements of a Dockerfile in any order.
upvoted 0 times
...
...
Ashlyn
2 months ago
Wow, this is a tricky one! I'm not sure if Docker executes all RUN statements in parallel or not. Let me think this through...
upvoted 0 times
Helaine
28 days ago
C) To avoid the creation of unnecessary images because Docker creates a new image for each RUN statement.
upvoted 0 times
...
Blair
1 months ago
B) To ensure the execution order of the commands because Docker might evaluate the statements of a Dockerfile in any order.
upvoted 0 times
...
Novella
1 months ago
A) To prevent the commands from running in parallel because Docker executes all RUN statements in their own container at the same time.
upvoted 0 times
...
...
Shelia
2 months ago
I disagree, I believe the correct answer is C.
upvoted 0 times
...
Roxanne
2 months ago
I think the answer is B.
upvoted 0 times
...

Save Cancel