Now let's start creating our first image using the Dockerfiles approach:
- Create a folder under
C:\
on Windows Server Containers host machine for storing our image artifacts; let's call itlearningwsc-chapter2
. - Create another folder within
learning-chapter2/hellodocker
, which will hold the artifacts for our first image. - Open a text editor such as notepad and copy the following contents into the file:
FROM microsoft/windowsservercore MAINTAINER [email protected] LABEL Description="IIS" Vendor=Microsoft" Version="10? RUN powershell -Command Add-WindowsFeature Web-Server COPY index.htm /inetpub/wwwroot/ EXPOSE 80 CMD [ "ping localhost -t" ]
- Save this file as Dockerfile under
learningwsc-chapter2/hellodocker
. - Make sure the file is saved without any extension.
Note
To save a file without any extensions under Windows, just surround the filename with ""
. In this example, save the file as "Dockerfile"
.
- Open notepad again and...