Install IIS In NANO Server Container

Install IIS IN NANO SERVER CONTAINER

In this blog, we will show you how to Install IIS in NANO Server container server using DISM commands.

SYSTEM REQUIREMENTS

  • Windows Container Host
  • IIS Package for NANO server

PREPARING FOR INSTALLATION

First download the IIS offline for nano server using below command.

Save-Module -Path “$Env:ProgramFiles\WindowsPowerShell\Modules\” -Name NanoServerPackage -MinimumVersion 1.0.1.0

Install IIS in NANO Server container
  • Then import the nanoserver package

Import-PackageProvider NanoServerPackage

Install IIS in NANO Server container
  • You can list the available nanoserver package using find command.

Find-NanoServerPackage *

Install IIS in NANO Server container
  • Download the IIS package for using the server to C:\Package folder using below command.

Save-NanoServerPackage -Name Microsoft-NanoServer-IIS-Package -Path C:\Package

Install IIS in NANO Server container
  • Mount windows 2016 ISO as a drive in windows container host server.
Install IIS in NANO Server container
  • Copy the nanoserver package from windows 2016 ISO to C:\packages folder on container host server. In this demonstration, the folder path is D:\NanoServer\Packages folder.
Install IIS in NANO Server container
Install IIS in NANO Server container

CREATING CONTAINER

  • Create a container using along with port mapping and folder sharing using below command.

docker run –name nanoiis -p 80:80 -it -v c:\install:c:\data microsoft/nanoserver powershell

docker – Base command for docker CLI

run – To start a new Container

–name nanoiis – To name the container

-p – Specify the port mapping

80 (left-hand side) source port– Map the windows container host port.

80 (right-hand side) Destination port – Map the container port.

-v – to map the local folder (or) data volume to a folder inside the container.

c:\install – It’s the source folder from the container host

c:\data – Define the path where the source folder to be mounted inside the container.

microsoft/nanoserver – Image to start the container

PowerShell – To kickstart a process inside the container

Install IIS in NANO Server container
  • Once the container is up and running, type dir to verify the data folder is available.
Install IIS in NANO Server container

INSTALLING IIS

  • Once the container is up and running, verify the data folder is available.
Install IIS in NANO Server container
  • Create a new folder name software
Install IIS in NANO Server container
  • Copy all the CAB files from data folder to software folder.
Install IIS in NANO Server container
Install IIS in NANO Server container
  • Execute the below command using the DISM tool.

Dism.exe /online /Add-Package /PackagePath:c:\software\Microsoft-NanoServer-IIS-Package__10-0-14393-0.cab

  • It will complete with errors. You can ignore it.
Install IIS in NANO Server container
  • Install the second CAB File.

Dism.exe /online /Add-Package /PackagePath:c:\software\Microsoft-NanoServer-IIS-Package_en-us_10-0-14393-0.cab

Install IIS in NANO Server container
  • Go ahead and install the Microsoft-NanoServer-IIS-Package CAB file using below command.

Dism.exe /online /Add-Package /PackagePath:c:\software\Microsoft-NanoServer-IIS-Package.cab

Install IIS in NANO Server container

Start the W3SVC service.

Install IIS in NANO Server container

VERIFYING IIS

  • We are able to access the nano server web application using window container host IP.
Install IIS in NANO Server container
  • You can download the nano server container image from docker repository.
Install IIS in NANO Server container

Thanks for reading this blog. We hope it was useful for you to learn how to install IIS on nano server container.

Loges