Creating a Docker image using a docker file
This example shows how to create a Microsoft Windows image with IIS installed. A list of official Microsoft images can be found on the docker hub website.
https://docs.microsoft.com/en-us/aspnet/mvc/overview/deployment/docker-aspnetmvc
- Create a file called ‘Dockerfile’ with the below content.
# The nano server version is way smaller at roughly 400MB vs 4GB for the full Windows IISFROM microsoft/aspnet
# Copy YOUR files from your local drive to the Docker image, can be static html pagesCOPY _site/ /inetpub/wwwroot- Create the docker image called myblog with a tag of iis
docker build -f .\Dockerfile -t myblog:iis .
or without specifying the Dockerfile as this is the default
docker build -t myblog:iis .- List newly created images and run the image
# View imagesdocker images
# Run the imagedocker run -d --name my-running-site myblog:iis- View the website in the browser
# Get the docker ip addressdocker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" my-running-site
Eg 172.22.208.164
Now open in browser Eg http://172.22.208.164

