Exam-Answer

Home / Microsoft / AZ-300 / Question 88

Prev Question
Next Question

Question 88

You want to create a simple container image that runs on Windows with Internet Information Services (IIS). The base image is named windows/iis.

The image should install Internet Information Services (IIS) and all the Node modules present in the packages.json file. Once installed, the image should load the Index.js file. Both files are in a subdirectory named app on your development computer. The files should be deployed to C:\app on the container.

You need to create the Dockerfile.

How should you complete the commands? Select correct placeholder values.

PLACEHOLDER 1 windows/iis

PLACEHOLDER 2 mkdir -p C:\app

PLACEHOLDER 3 app C:/app

PLACEHOLDER 4 C:/app

PLACEHOLDER 5 npm install

PLACEHOLDER 6 node index.js

Answers


Advertisement

Explanation

You should first run FROM windows/iis. The FROM command specifies the container image from which the newly created image is based. In this scenario, it is a Microsoft Windows image with IIS.

Next you should run RUN mkdir -p C:\app. This creates a directory named app on the C: drive on the container.

Next you should run COPY ./app/* C:\app. This copies the files from the app subdirectory on your development computer to the C:\app directory on the container.

Next you should run WORKDIR c:\app. This changes the working directory to C:\app on the container.

Next you should run RUN npm install. This installs the Node modules from the package.json file in the current directory, which is C:\app.

Next you should run CMD node Index.js. This runs the Node server and loads Index.js.

References

Comments

Load more
Prev Question
Next Question