New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

LPI 701-100 Exam - 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:

0/2000 characters
Carman
3 months ago
I think it's mainly to avoid unnecessary images.
upvoted 0 times
...
Lennie
3 months ago
It's about execution order too, right?
upvoted 0 times
...
Leanora
3 months ago
Wait, I thought each RUN was in its own container?
upvoted 0 times
...
Danica
4 months ago
Totally agree, it keeps the image size down!
upvoted 0 times
...
Leonor
4 months ago
Combining RUN statements reduces image layers.
upvoted 0 times
...
Marylou
4 months ago
I vaguely recall that Docker checks the success of commands, but I'm not completely certain if that's why we combine them.
upvoted 0 times
...
Chaya
4 months ago
I feel like the order of execution is important, but I thought Docker always runs commands in the order they appear.
upvoted 0 times
...
Jani
4 months ago
I remember something about Docker creating a new layer for each RUN statement, so maybe it's to avoid that?
upvoted 0 times
...
Evangelina
5 months ago
I think combining the commands helps with efficiency, but I'm not sure if it's about avoiding unnecessary images or execution order.
upvoted 0 times
...
Crista
5 months ago
Ah, I see now. Combining the commands in a single RUN statement is more efficient than using multiple RUN statements. That makes sense.
upvoted 0 times
...
Brice
5 months ago
I'm not entirely sure about this one. I'll have to read the question again and consider the different options.
upvoted 0 times
...
Thaddeus
5 months ago
Okay, I think I know the answer to this one. The key is understanding how Docker handles RUN statements.
upvoted 0 times
...
Kristel
5 months ago
Hmm, I'm a bit confused by the multiple RUN statements. I'll have to review my Docker knowledge to figure this out.
upvoted 0 times
...
Rima
5 months ago
This looks like a tricky Docker question. I'll need to think it through carefully.
upvoted 0 times
...
Emerson
5 months ago
Observability is all about being able to monitor and understand the internal workings of the system, so D seems like the best choice here. I'm pretty confident in this answer.
upvoted 0 times
...
Sheldon
5 months ago
I feel like signing was mentioned as essential in class—definitely need it to confirm the authority. Verification seems crucial too!
upvoted 0 times
...
Ozell
5 months ago
I remember a question like this where we discussed incident volume reduction. It might be too optimistic to expect that.
upvoted 0 times
...
Gianna
5 months ago
I'm a bit stuck on this one. I know SONET/SDH and Ethernet are common protocols, but I'm not sure which one is used for the 10G encryption card.
upvoted 0 times
...
Adolph
10 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
8 months 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
9 months ago
C) To avoid the creation of unnecessary images because Docker creates a new image for each RUN statement.
upvoted 0 times
...
Glory
9 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
...
...
Celeste
10 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
10 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
10 months ago
C) To avoid the creation of unnecessary images because Docker creates a new image for each RUN statement.
upvoted 0 times
...
Nelida
10 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
10 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
10 months ago
But wouldn't combining the commands in one RUN statement reduce the number of images created?
upvoted 0 times
...
Yasuko
11 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
9 months ago
C) To avoid the creation of unnecessary images because Docker creates a new image for each RUN statement.
upvoted 0 times
...
Tandra
9 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
...
Roxane
9 months ago
C) To avoid the creation of unnecessary images because Docker creates a new image for each RUN statement.
upvoted 0 times
...
Halina
9 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
11 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
9 months ago
C) To avoid the creation of unnecessary images because Docker creates a new image for each RUN statement.
upvoted 0 times
...
Blair
10 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
10 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
11 months ago
I disagree, I believe the correct answer is C.
upvoted 0 times
...
Roxanne
11 months ago
I think the answer is B.
upvoted 0 times
...

Save Cancel