Containerised IIS Application to windows Container

Containerised IIS Application to windows Container

Containerised IIS Application to Windows Container

In this blog, we will show you the steps to containerised IIS Application to Windows Container in Windows 2016.

 

REQUIREMENTS

  • VHD (or) VHDX image with IIS role & ASP.NET application.
  • Container host with Decker role installed.
  • Any machine with Windows 2012, 2012 R2 (or) 2016 to run the image conversion tool.

 

PREPARING VHD (or) VHDX IMAGE

Note: In this demo, we are using windows 2008 VM along with .NET 4.5.2 and IIS service Installed.

 

  • We have installed IIS service and hosted a Test ASP.NET Application.

Convert IIS Application VM to windows Container

 

  • We are able to access the test application using the server IP without any problem.

Convert IIS Application VM to windows Container

 

  • Copy the server VHD file to a separate location for the conversion process.

 

Note : For this demo, we are using windows 2016 machine to run the image conversion process. You can also using windows 2012 with powershell version 5.0.

 

  • We create a folder named VHD in C:\ drive and copy the VHD files into that folder.

Convert IIS Application VM to windows Container

 

INSTALLING IMAGE CONVERSION TOOL

  • Open the PowerShell window and execute the below command.

Install-Module -Name Image2Docker

 

Convert IIS Application VM to windows Container

 

Note : This is tool is still under development. You can find the latest version of this tool from this URL : https://www.powershellgallery.com/packages/Image2Docker/1.8.2.

 

CUSTOMIZE THE IMAGE2DOCKER MODULE

  • We need to make minor changes in the image2docker template file to make the ASP.NET application workable.

 

  • To Find the installed path of image2docker module, execute the below command from the PowerShell window.

($PSModPath=gmo -l).path

 

Convert IIS Application VM to windows Container

 

  • Go to C:\Program Files\WindowsPowerShell\Modules\Image2Docker\1.8.2\Resources folder.

Convert IIS Application VM to windows Container

 

  • Double click on Dockerfile-ASPNET-35.template file and add the below lines.

# Install Web Server Components
RUN Install-WindowsFeature -name web-app-dev –IncludeAllSubFeature

 

Convert IIS Application VM to windows Container

 

  • Save the file and close it.

 

EXECUTING IMAGE2DOCKER

  • Once you installed and customize the image2docker module, open the PowerShell window and execute the below command to extract all the website from IIS and its configuration.

SYNTAX: ConvertTo-Dockerfile -ImagePath <VHD path> -OutputPath <path to save the IIS configuration> -Artifact IIS –Verbose

COMMAND : ConvertTo-Dockerfile -ImagePath C:\VHD\Conttest.vhdx -OutputPath C:\VHD\conttest -Artifact IIS –Verbose

Convert IIS Application VM to windows Container

 

  • Open C:\VHD\conttest folder and verify the website configuration files.

Convert IIS Application VM to windows Container

 

  • Open the dockerfile and verify our customize entry was added in the docker file.

Convert IIS Application VM to windows Container

 

IMPORT IIS FILES TO CONTAINER HOST

  • Login into container host machine and access the conttest folder through a network share.

\\192.168.232.17\c$\VHD

 

Note : This is our lab setup. So the IP might vary based on your environment

Convert IIS Application VM to windows Container

 

  • Copy the conttest folder from the shared location to the container host local drive.

Convert IIS Application VM to windows Container

 

BUILDING THE CONTAINER

  • Open the PowerShell window and execute the below command to build a container.

docker build -t conttest c:\conttest

Convert IIS Application VM to windows Container

 

  • It will take few minutes to complete the container building process.

Convert IIS Application VM to windows Container

  • Once the build completed successfully. Type docker images command to verify the image.

Convert IIS Application VM to windows Container

 

VERIFYING THE CONTAINER

  • From the PowerShell window, type the below command to create a new container in detach mode.

SYNTAX: docker run –d <container image name>

COMMAND: docker run –d conttest

Convert IIS Application VM to windows Container

 

  • Type docker ps to verify the container name

Convert IIS Application VM to windows Container

 

  • To find the IP address of the container uses the below command.

SYNTAX: docker inspect <container ID>

COMMAND: docker inspect d4

 

Convert IIS Application VM to windows Container

Convert IIS Application VM to windows Container

 

  • Browse the IP 172.28.238.72 from the container host and verify the ASP.NET application.

Convert IIS Application VM to windows Container

VIDEO

Thanks for reading this blog. We hope it was useful for you to learn how to convert the IIS application VM to Docker container.

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn
More Interested Related Posts
zfs pool usage

ZFS Pool and Dataset Usage

ZFS Pool and Dataset Usage   I am back with another blog to provide the useful script to the Freebsd users to determine the zpool

Assistanz Networks

Installing Zabbix Agent in FreeBSD 12.0

Zabbix Agent Installation and Configuration Guide on FreeBSD 12.0   Zabbix is an open-source monitoring software tool for diverse IT components, including networks, servers, virtual

DirectAdmin Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk
$ 99 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • NDA & SLA
  • SLA Review Meetings
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation
  •  

Platinum Support

24/7 Proactive Support
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Support

$ 30 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response Time
  • 4 Hours Resolution time for the Possible Issues
  • Security and Performance Optimization
  • React to Customers queries
  • Simple SignUp Process
  • Instant Account Activation
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support