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

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.

主站蜘蛛池模板: 上饶县| 鄂托克前旗| 叶城县| 武宣县| 馆陶县| 阿尔山市| 灵武市| 牟定县| 弥勒县| 平顶山市| 上饶市| 喀什市| 云梦县| 读书| 从化市| 涿鹿县| 奎屯市| 崇仁县| 岗巴县| 连江县| 油尖旺区| 佳木斯市| 唐山市| 桂阳县| 且末县| 金秀| 勃利县| 石屏县| 黄龙县| 密山市| 北流市| 开江县| 绥江县| 探索| 金秀| 钟山县| 平谷区| 五寨县| 永顺县| 象山县| 九台市|