×
Install IIS in NANO Server container
Blog Containers

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.

7 thoughts on “Install IIS in NANO Server container”

  1. I do everything and I am limited to the level of deploying an application in a container container on nano server

  2. Regarding your query, Microsoft is still under development of Nano server technology. Please elaborate your requirement and the application type, so that we will be in better position to provide suggestion on this task

  3. Hello,
    PS C:\WINDOWS\system32> Import-PackageProvider NanoServerPackage
    Import-PackageProvider : No match was found for the specified search criteria and provider name ‘NanoServerPackage’.
    Try ‘Get-PackageProvider -ListAvailable’ to see if the provider exists on the system.
    At line:1 char:1
    + Import-PackageProvider NanoServerPackage
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidData: (NanoServerPackage:String) [Import-PackageProvider], Exception
    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.ImportPackageProv
    ider

    I was trying to follow through the Install IIS in NANO Server container article but I got the above error.

    Please, can you really help step by step how to install IIS on Nano server for the deployment of an API service.

    Thank you.

  4. So with the errors I cannot make a Dockerfile in order to automate my deployments. How do you get around that?
    thanks,
    Greg

  5. Hi Greg,

    We are still working to find a workaround for this issue. Let you know once we find a solution. Also if you find an alternate way to resolve this issue, please share with us.

  6. Well I got it to work, it’s not a true fix, but it is a workaround and it allows me to build my image. Put & at the end of the RUN command so that it tricks docker build into thinking it exited cleanly. here is my Dockerfile:

    #nano server + IIS

    FROM microsoft/nanoserver

    MAINTAINER gmatz

    ADD software software
    RUN Dism.exe /online /Add-Package /PackagePath:c:\software\Microsoft-NanoServer-IIS-Package__10-0-14393-0.cab &
    RUN Dism.exe /online /Add-Package /PackagePath:c:\software\Microsoft-NanoServer-IIS-Package_en-us_10-0-14393-0.cab &
    RUN Dism.exe /online /Add-Package /PackagePath:c:\software\Microsoft-NanoServer-IIS-Package.cab &
    RUN powershell -command rm -Recurse C:\software -Force

    it works, but it looks like it shouldn’t .

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.