nerdexam
MicrosoftMicrosoft

AZ-204 · Question #34

AZ-204 Question #34: Real Exam Question with Answer & Explanation

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. https://docs.docker.com/v17.09/engine/usergu

Submitted by ahmad_uae· Mar 30, 2026

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.

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

Community Discussion

No community discussion yet for this question.

Full AZ-204 PracticeBrowse All AZ-204 Questions