nerdexam
Microsoft

AZ-400 · Question #142

A team has the following DockerFile that will create an image FROM windowsservercore RUN powershell.exe -Command Invoke-WebRequest RUN powershell.exe -Command Start-Process c:\python-3.5.1.exe -Argume

The correct answer is C. Ensure to have only one RUN command. https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/optimize- windows-dockerfile

Submitted by carlos_mx· Mar 6, 2026Design and implement build and release pipelines

Question

A team has the following DockerFile that will create an image FROM windowsservercore RUN powershell.exe -Command Invoke-WebRequest RUN powershell.exe -Command Start-Process c:\python-3.5.1.exe -ArgumentList '/quiet InstallAllUsers=1 PrependPath=1' -Wait RUN powershell.exe -Command Remove-Item c:\python-3.5.1.exe -Force You need to ensure that you optimize the DockerFile. Which of the following can you do to create an optimized DockerFile?

Options

  • AChange the base image
  • BPlace an ENTRYPOINT
  • CEnsure to have only one RUN command
  • DCreate a working directory

How the community answered

(27 responses)
  • A
    7% (2)
  • B
    4% (1)
  • C
    78% (21)
  • D
    11% (3)

Explanation

https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/optimize- windows-dockerfile

Topics

#Dockerfile optimization#Docker layers#RUN commands#containerization

Community Discussion

No community discussion yet for this question.

Full AZ-400 Practice