- 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 Java Functional Programming
- Java持續交付
- 秒懂設計模式
- 深度學習:算法入門與Keras編程實踐
- 面向對象程序設計(Java版)
- iOS編程基礎:Swift、Xcode和Cocoa入門指南
- Haskell Data Analysis Cookbook
- JavaCAPS基礎、應用與案例
- Red Hat Enterprise Linux Troubleshooting Guide
- 計算機應用基礎項目化教程
- 從程序員角度學習數據庫技術(藍橋杯軟件大賽培訓教材-Java方向)
- Mockito Essentials
- C++ System Programming Cookbook
- 從零開始學UI:概念解析、實戰提高、突破規則
- 例解Python:Python編程快速入門踐行指南