Windows 2019
Sponsored Link

Docker : Use Dockerfile
Use Dockerfile and create Docker images automatically.
It is also useful for configuration management.
[1] For example, Create a Dockerfile to install IIS.
PS C:\Users\Administrator>
mkdir docker-test

PS C:\Users\Administrator\docker-test>
cd docker-test

PS C:\Users\Administrator\docker-test>
cat Dockerfile

# create a new file like follows with notepad or other text editor on GUI
MAINTAINER ServerWorld <>

RUN dism.exe /online /enable-feature /all /featurename:iis-webserver /NoRestart
RUN echo Dockerfile test example > C:\inetpub\wwwroot\index.html

CMD [ "cmd" ]

# build image ⇒ docker build -t [image name]:[tag] .

PS C:\Users\Administrator\docker-test>
docker build -t iis_server:latest .

Sending build context to Docker daemon  2.048kB
Step 1/6 : FROM
 ---> 640a8acbeb6f
Step 2/6 : MAINTAINER ServerWorld <>
 ---> Running in 059576eb0100
Removing intermediate container 059576eb0100
 ---> 8d82163b2683
Step 3/6 : RUN dism.exe /online /enable-feature /all /featurename:iis-webserver /NoRestart
 ---> Running in 17e24ac8c944
Successfully built 0ca3973f3882
Successfully tagged iis_server:latest

PS C:\Users\Administrator\docker-test>
docker images

REPOSITORY                             TAG                 IMAGE ID            CREATED             SIZE
iis_server                             latest              0ca3973f3882        6 minutes ago       4.43GB   1809                640a8acbeb6f        6 days ago          4.28GB

# run Container on background

PS C:\Users\Administrator\docker-test>
docker run -t -d -p 8081:80 iis_server

PS C:\Users\Administrator\docker-test>
docker ps

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                  NAMES
780bf1b4db59        iis_server          "cmd"               17 seconds ago      Up 14 seconds>80/tcp   wonderful_heyrovsky

# verify accesses

PS C:\Users\Administrator\docker-test>
curl.exe localhost:8081

Dockerfile test example
Matched Content