Requirement is to understand how to deploy IIS based website in the container.
To play around, create a Windows Server 2016 based VM in MS Azure.
Steps to follow –
- Configure Docker environment in Windows Server 2016:
Run the below commands –
- Install-PackageProvider -Name NuGet -MinimumVersion 18.104.22.168 -Force
- Install-Module -Name DockerMsftProvider –Force
- Install-Package -Name docker -ProviderName DockerMsftProvider -Force
- Restart-Computer –Force
2. To verify, it it is installed correctly, Run the command –
3. Next step is to pull the IIS image from docker secured registry. Run the below command –
docker pull Microsoft/iis
This command will take some time to pull and extract the IIS image onto the server. Once completed successfully, run the command “docker images” to list the images pulled from DSR.
4. Run the following command to start the container –
docker run –d –name myFirstIIS –p 80:80 microsoft/iis
5. Run the following command to list all the running containers –
docker ps –a
docker container ls
6. Run the following command to open the command prompt inside the container – docker exec –I myFirstIIS cmd
7. Write index.html in the inetpub of the IIS in the container as –
echo "Hello World From a Windows Server Container" > C:\inetpub\wwwroot\index.html
7. Browse the IIS site as shown below –
All the steps above can be done through DockerFile concept. I will explain it in the next article.
——End of the Article—–