Independence Day Deal! Unlock 25% OFF Today – Limited-Time Offer - 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
1 months 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
Robt
12 hours ago
Haha, that would be funny! But it looks like the answer is B) To ensure the execution order of the commands because Docker might evaluate the statements of a Dockerfile in any order.
upvoted 0 times
...
Kris
11 days ago
C) To avoid the creation of unnecessary images because Docker creates a new image for each RUN statement.
upvoted 0 times
...
Glory
16 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
2 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
23 days ago
C) To avoid the creation of unnecessary images because Docker creates a new image for each RUN statement.
upvoted 0 times
...
Tandra
24 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
27 days ago
C) To avoid the creation of unnecessary images because Docker creates a new image for each RUN statement.
upvoted 0 times
...
Halina
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
...
...
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
1 months ago
C) To avoid the creation of unnecessary images because Docker creates a new image for each RUN statement.
upvoted 0 times
...
Blair
2 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
2 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
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77