Microsoft Azure Architect Technologies (2020, legacy) — Question 67
You have a server named Server1 that runs Windows Server 2019. Server1 is a container host.
You plan to create a container image.
You create the following instructions in a text editor.
FROM mcr.microsoft.com/windows/servercore:lts2019
LABEL maintainer="[email protected]"
RUN dism.exe /online /enable-feature /all /featurename:iis-webserver /NoRestart
RUN echo "Hello World!" > c:\inetpub\wwwroot\index.html
You need to be able to automate the container image creation by using the instructions.
To which file should you save the instructions?
Answer options
- A. dockerconfig.json
- B. Dockerfile
- C. daemon.json
- D. Build.ini
Correct answer: B
Explanation
The correct answer is B, Dockerfile, as this is the standard file used to define the steps needed to create a Docker image. The other options, such as dockerconfig.json and daemon.json, serve different purposes and are not designed for writing build instructions for container images.