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
- Then import the nanoserver package
Import-PackageProvider NanoServerPackage
- You can list the available nanoserver package using find command.
Find-NanoServerPackage *
- 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
- Mount windows 2016 ISO as a drive in windows container host server.
- 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.
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
- Once the container is up and running, type dir to verify the data folder is available.
INSTALLING IIS
- Once the container is up and running, verify the data folder is available.
- Create a new folder name software
- Copy all the CAB files from data folder to software folder.
- 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 the second CAB File.
Dism.exe /online /Add-Package /PackagePath:c:\software\Microsoft-NanoServer-IIS-Package_en-us_10-0-14393-0.cab
- 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
Start the W3SVC service.
VERIFYING IIS
- We are able to access the nano server web application using window container host IP.
- You can download the nano server container image from docker repository.
Thanks for reading this blog. We hope it was useful for you to learn how to install IIS on nano server container.
Loges