Microsoft
AZ-204 · Question #34
You maintain an Azure Web App that runs in a container. The container is using a DockerFile that is copied to numerous places and consumes a large amount of storage. You need to optimize the…
The correct answer is C. Minimize layers by grouping actions in as few RUN instructions as possible. Minimize the number of layers. Prior to Docker 17.05, and even more, prior to Docker 1.10, it was important to minimize the number of layers in your image.C In Docker 1.10 and higher, only RUN, COPY, and ADD instructions create layers…
Submitted by ahmad_uae· Mar 30, 2026Develop Azure compute solutions
Question
You maintain an Azure Web App that runs in a container. The container is using a DockerFile that is copied to numerous places and consumes a large amount of storage. You need to optimize the Dockerfile. What should you do?
Options
- AMinimize layers by concatenating all RUN instructions on one line.
- BConfigure the CLI with a .dockerignore file.
- CMinimize layers by grouping actions in as few RUN instructions as possible.
- DUse multiple RUN instructions for cached operation.
How the community answered
(37 responses)- A14% (5)
- B3% (1)
- C76% (28)
- D8% (3)
Explanation
Minimize the number of layers. Prior to Docker 17.05, and even more, prior to Docker 1.10, it was important to minimize the number of layers in your image.C In Docker 1.10 and higher, only RUN, COPY, and ADD instructions create layers. https://docs.docker.com/v17.09/engine/userguide/eng-image/dockerfile_best-practices
Topics
#Dockerfile optimization#container layers#Azure Web App#RUN instructions
Community Discussion
No community discussion yet for this question.