Pre-Req Considerations and Quick Start guide to Containerizing legacy apps

Considerations: Some of the things to consider when looking at candidate legacy applications for Containerization

1 High What are pre-requisites required to setup app into new box?
2 Medium Which - .NET Frameworks Version required for app?
3 Medium Does app use Authentication/Authorization? [Ad, AAD, custom...]
4 Medium Does app use Session State / Data Persistence?
5 High Does app do any kind of logging - Centralized/File system, Windows event log?
6 High Does app use  certificates?
7 High Does app uses - Commercial/Professional Software (e.g. SharePoint, SQL Server, SAP, Oracle, Site core)?
8 Low Does app has - Strict security / compliance requirements? (Need clarification on this questions)
9 Medium Does app use Multiple disks?
10 Medium Does app use Multiple web apps or virtual directory?
11 Medium Does app require specific Registry Settings?
12 Medium Does app utilize File Shares?
13 Medium Does app require specific NTFS file/folder permissions?
14 Medium Does app require Registering GAC / ActiveX components?
15 Medium Does app require any 3rd party component like SMTP etc.?
16 Medium Does app need DNS/IP mapping?
17 Medium Does app require Multiple domain support?
19 Medium Does app require Scheduled Task Support?
20 High Does app have dependency? what are upstream/downstream apps?

Steps to Containerize an application

  1. Copy the working bits to the folder.
  2. Create a file and save it as “dockerfile”. * Without any extension.
  3. Take the image you want to built for the docker file. “FROM microsoft/aspnet”
  4. Copy the compiled files to the image “ADD ./<WebApp>/ "c:/inetpub/wwwroot/<WebApp>"”
  5. Set the powershell as default shell for running the subsequent commands.
  6. Install the IIS feature if required.
  7. If required to enable or disable any property use the powershell commands.RUN Set-WebConfigurationProperty -filter /system.webServer/security/authentication/windowsAuthentication -name enabled -value true -PSPath IIS:\ ;
  8. RUN Set-WebConfigurationProperty -filter /system.WebServer/security/authentication/AnonymousAuthentication -name enabled -value false -PSPath IIS:\ ;
  9. If you want to add any user as the administrator you can use the command
  10. If need to edit any registry use the commands like
  11. RUN New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\lsa -Name DisableLoopbackCheck -Value 1 -PropertyType DWORD -Force | Out-Null
  12. Start the web service in the application..
  13. RUN New-Website -Name 'Webapp' -Port 8086 \
  14.    -PhysicalPath 'c:\inetpub\wwwroot\WebApp' -ApplicationPool '.NET v4.5'
  15. To expose the port from the container you can use EXPOSE 8086
  16. If you want to execute some common script you want to start every time a container start
  17. ENTRYPOINT ["Powershell", "C:/entrypoint.ps1"]
  18. Where entrypoint.ps1 can be a file consisting of all the powershell commands required to run in the container for server setup
  19. All this command can be composed into a single docker file and store it with the compiled code.\
  20. After creation of the docker file create the image