Using the main Dockerfile instructions

The Dockerfile syntax is very simple. You've already seen FROM, COPY, 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 in the default website, which shows some basic details:

# escape=`FROM microsoft/iisSHELL ["powershell"]ARG ENV_NAME=DEVEXPOSE 80COPY template.html C:\template.htmlRUN (Get-Content -Raw -Path C:\template.html) ` -replace '{hostname}', [Environment]::MachineName ` -replace '{environment}', [Environment]::GetEnvironmentVariable( ...

Get Docker on Windows 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.