官术网_书友最值得收藏!

Creating a Dockerfile

As we will be hosting the web page in the container using IIS, we need to create a Dockerfile that uses the mcr.microsoft.com/windows/servercore/iis official image as the base image for the build. We will use a Docker image with the windowsservercore-1903 tag to ensure that we are running a version that matches the host OS and make it possible to use process isolation.

Create a new file in your workspace named Dockerfile, containing the following:

FROM mcr.microsoft.com/windows/servercore/iis:windowsservercore-1903

RUN powershell -NoProfile -Command Remove-Item -Recurse C:\inetpub\wwwroot\*
WORKDIR /inetpub/wwwroot
COPY index.html .

Visual Studio Code gives you a lot of snippets while writing the Dockerfile, providing that you have named the file following the expected convention. You can also bring up the list of snippets by pressing Ctrl + SPACE while editing.

In the next subsection, you will learn how to manually build a Docker image based on the Dockerfile you have just created.

主站蜘蛛池模板: 花莲市| 平和县| 三原县| 奉新县| 扎鲁特旗| 辉南县| 遵义县| 蒙山县| 宝坻区| 东阳市| 红河县| 呼和浩特市| 南雄市| 班玛县| 顺昌县| 台东县| 陵川县| 黄骅市| 陵川县| 二连浩特市| 东明县| 古蔺县| 仁化县| 玉山县| 安福县| 来凤县| 江津市| 泗水县| 定南县| 雅安市| 治县。| 巴林左旗| 忻州市| 东莞市| 克山县| 河北省| 华容县| 新巴尔虎右旗| 扎鲁特旗| 禄丰县| 大宁县|