Microsoft

AZ-800 practice question 149

Administering Windows Server Hybrid Core Infrastructure · free question 149 of 246

Question

You have a Docker host. You need to create a Windows Server container image that will include an installation of Python. How should you complete the Dockerfile? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point. Dockerfile: [Selection 1: parser directive] FROM mcr.microsoft.com/windows/servercore:ltsc2025 RUN powershell.exe -Command wget https://www.python.org/ftp/python/3.10.16/python-3.10.16.exe; [Selection 2] Start-Process c:\python-3.10.16.exe -ArgumentList '/quiet InstallAllUsers=1 PrependPath=1' -Wait

Explanation

Parser directive line (before FROM): # escape=` — The escape parser directive changes the character Docker treats as the escape and line-continuation character, and it must appear at the very top of the Dockerfile, before FROM. Windows Dockerfiles commonly switch it to the backtick because the default escape character, the backslash, is also the Windows path separator, so paths such as c:\python-3.10.16.exe could otherwise be misread. # syntax= selects a BuildKit frontend and # check= configures build checks; neither changes the escape character. Line-continuation character at the end of the first RUN line: ` — After the directive sets the escape character to the backtick, that character continues the RUN instruction onto the next line, so the download and the silent Start-Process install of python-3.10.16.exe run as one instruction. The backslash no longer has that role once the directive has reassigned it, and the forward slash has no line-continuation meaning in a Dockerfile.

Need the theory? Learn it free in the AZ-800 course on Godlike Academy

Practice the whole free set

AZ-800 is a free exam: all 300 questions with instant feedback, plus Learn and Exam modes and PDF export, free.