Using the main Dockerfile instructions

The Dockerfile syntax is very simple. You've already seen FROM, COPY, USER, RUN, and CMD, which are enough to package up a basic application to run as a container. For real-world images you'll need to do more than that, and there are three more key instructions to understand.

Here's a Dockerfile for a simple static website; it uses Internet Information Services (IIS) and serves an HTML page on the default website, which shows some basic details:

# escape=`FROM mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2019SHELL ["powershell"]ARG ENV_NAME=DEVEXPOSE 80COPY template.html C:\template.htmlRUN (Get-Content -Raw -Path C:\template.html) ` -replace '{hostname}', [Environment]::MachineName ...

Get Docker on Windows - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.