top of page

How to Build Windows Core Server with Internet Information Services (IIS) Container in Docker and Ho

  • Mohan Sekar
  • Nov 14, 2017
  • 1 min read

Steps to build a microsoft/iis docker container and hosting the website:-

1.Create a Dockerfile with your website

FROM microsoft/iis RUN mkdir “C:\site\website” RUN powershell -NoProfile -Command \ Import-module IISAdministration; \ New-IISSite -Name “mohan.sekar.com” -PhysicalPath “C:\site\website” -BindingInformation “*:80:mohan.sekar.com” EXPOSE 80 ADD WebsiteContent/ /site/website

Note: Your WebsiteContent folder should be present in the same path of Dockerfile

2.You can then build and run the Docker image

docker build -t mohan.sekar.com . docker run -d -p 80:80 –name mohan.sekar.com mohan.sekar.com

3.Check the website container is running

docker ps -l

4.Find the IP address of running website container

docker inspect -f “{{ .NetworkSettings.Networks.nat.IPAddress }}” mohan.sekar.com

You will see an output similar to this:

172.21.89.189

5.You can connect the running container using the IP address and configured port, http://172.21.89.189 (or) http://172.21.89.189:80 in the example shown.

6.If you want to connect the website using hostheader, then add “172.21.89.189 mohan.sekar.com” content in host file. then launch the http://mohan.sekar.com url outside the container.

Comments


RECENT POSTS:
SEARCH BY TAGS:

© 2023 by NOMAD ON THE ROAD. Proudly created with Wix.com

  • b-facebook
  • Twitter Round
  • Instagram Black Round
bottom of page