Automating Container Image Creation with Windows Server 2019: Exam AZ-303 Answer

Automating Container Image Creation with Windows Server 2019

Question

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="User1@contoso.com"

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?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

B

The Dockerfile is a text file that contains the instructions needed to create a new container image.

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

The correct answer is B. Dockerfile.

Docker is a popular platform for developing, shipping, and running applications in containers. Containers are lightweight and portable virtualized environments that can run on any machine that has a Docker runtime installed. A Dockerfile is a text file that contains instructions for building a Docker image. The Docker image is a read-only template that can be used to create a Docker container. The Dockerfile consists of a set of commands that are executed in order to create the image.

In this scenario, you have a Windows Server 2019 container host named Server1. You plan to create a container image using a set of instructions. The instructions include a base image (FROM), a label (LABEL), and two commands (RUN) that install and configure IIS web server and create an index.html file in the default website directory. To automate the container image creation, you need to save the instructions in a file named Dockerfile.

Option A, dockerconfig.json, is incorrect. This file is used to store Docker client configuration settings such as authentication credentials, registry settings, and network settings.

Option C, daemon.json, is also incorrect. This file is used to configure Docker daemon settings such as network, logging, and storage drivers.

Option D, Build.ini, is an invalid option. There is no such file in Docker.

In summary, a Dockerfile is a text file that contains instructions for building a Docker image. It is the correct file to save the instructions for automating the creation of a container image in this scenario.