- Hands-On Kubernetes on Windows
- Piotr Tylenda
- 156字
- 2021-06-24 16:53:59
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.
推薦閱讀
- Learning Scala Programming
- Python快樂編程:人工智能深度學習基礎
- Python編程與幾何圖形
- 你不知道的JavaScript(中卷)
- 零基礎入門學習Python
- Learning Salesforce Einstein
- Extending Puppet(Second Edition)
- Access 2010數據庫應用技術(第2版)
- JavaCAPS基礎、應用與案例
- INSTANT Adobe Edge Inspect Starter
- Couchbase Essentials
- Spring技術內幕:深入解析Spring架構與設計原理(第2版)
- JavaScript+jQuery網頁特效設計任務驅動教程
- Kotlin極簡教程
- Mockito Essentials