Image2docker for ASP.NET Websites: Part 2

Docker

This is a continuation of the previous posts that covered how to setup and run Image2Docker.

Docker Installation Status
  • Open PowerShell command and execute the following command.
  • docker info
  • Docker is already installed in the system If the command returns something like the below.

  • The docker is not installed in the machine if you see the error like below


Install Docker if not exists
  • Please follow the instructions below if docker is not installed in your machine.
  • Install the Docker-Microsoft PackageManagement Provider from the PowerShell Gallery.
    Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
  • Next, you use the PackageManagement PowerShell module to install the latest version of Docker.
    Install-Package -Name docker -ProviderName DockerMsftProvider
  • When PowerShell asks you whether to trust the package source 'DockerDefault', type A to continue the installation. When the installation is complete, reboot the computer.
    Restart-Computer -Force
        Tip: If you want to update Docker later:
        Check the installed version with
     
                    Get-Package -Name Docker -ProviderName DockerMsftProvider 

    Find the current version with    

     
                    Find-Package -Name Docker -ProviderName DockerMsftProvider 

    When you're ready, upgrade with

     
                    Install-Package -Name Docker -ProviderName DockerMsftProvider -Update -Force 
     
                    Start-Service Docker 
  • Ensure your Windows Server system is up-to-date by running. Run the following command.
     
                    Sconfig 
    • This shows a text-based configuration menu, where you can choose option 6 to Download and Install Updates.
       
                      
                      ===============================================================================
                                               Server Configuration
                      ===============================================================================
                      
                      1) Domain/Workgroup:                    Workgroup:  WORKGROUP
                      2) Computer Name:                       WIN-HEFDK4V68M5
                      3) Add Local Administrator
                      4) Configure Remote Management          Enabled
                      
                      5) Windows Update Settings:             DownloadOnly
                      6) Download and Install Updates
                      7) Remote Desktop:                      Disabled
                      ...
                       
    •  When prompted, choose option A to download all updates.
Create Containers from Imag2Docker Dockerfile.
  • Make sure that docker installed on your Windows 2016 or Windows 10 with Anniversary updates.
  • To build that Dockerfile into an image, run:
     
                    docker build -t img2docker/aspnetwebsites. 
  • Here img2docker/aspnetwebsites is the name of the image. You can give your own name based on your needs.
  • When the build completes, we can run a container to start my ASP.NET sites.
  • This command runs a container in the background, exposes the app port, and stores the ID of the container.
     
                    $id = docker run -d -p 81:80 img2docker/aspnetwebsites 

    Here 81 is the host port number and 80 is the container port number.

  • When the site starts, we will see in the container logs that the IIS Service (W3SVC) is running:
     
                    docker logs $id 

    The Service 'W3SVC' is in the 'Running' state.

  • Now you can browse to the site running in IIS in the container, but because published ports on Windows containers don’t do loopback yet, if you’re on the machine running the Docker container, you need to use the container’s IP address:
     
                    $ip = docker inspect --format '{{ .NetworkSettings.Networks.nat.IPAddress }}' 
     
                    $id 
     
                    start http://$($ip) 

That will launch your browser and you’ll see your ASP.NET Web application running in IIS, in Windows Server Core, in a Docker container.

Share this:

Take a look at the lastest aricles

Executive Summary Crystal Reports is aging out. Talent is shrinking. The modern stack has moved on. Yet migration projects stall because they are manual, error-prone, and slow. This article introduces a multi-agent AI pipeline — six specialist agents, each evaluated before advancing — that automates the Crystal-to-Power BI conversion end to end. Six Agents, Six […]

Seattle – [Mar23, 2026] – CloudIQ Technologies Inc today announced it has earned the AI Apps on Microsoft Azure specialization, a validation of a solution partner’s deep knowledge, extensive experience, and proven expertise in designing, developing, and deploying AI-powered applications on Microsoft Azure. Only partners that meet stringent criteria around customer success and staff skilling, […]

An SRE Perspective on Circuit Isolation, Fallback Traffic & Reliability Control Engineering resilience into a system is only half the story. Operating it under real-world load is the other half. A distributed cache protected by circuit breakers and automatic fallback is a powerful architectural construct. But from a DevOps and SRE perspective, the critical questions […]

Let’s shape your AI-powered future together.

Partner with CloudIQ to achieve immediate gains while building a strong foundation for long-term, transformative success.