Public Repository

Last pushed: 4 months ago
Short Description
Nano Server + IIS. Updated on 08/01/2017. Version: 10.0.14393.1480
Full Description

Windows Container Based: microsoft/nanoserver. IIS rol added.

How to use:

Install docker on your OS (Windows 10, Windows Server 2016, Nano Server, etc.).
Once docker is installed, execute in elevated prompt (PowerShell 5, etc):
docker pull nanoserver/iis

To run docker just type:
docker run --name nanoiis -d -it -p 80:80 nanoserver/iis

Show base images:
docker images

Show running containers:
docker ps -a -f status=running

Show container IP:
docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" nanoiis

Show containerID:
docker inspect --format="{{.Id}}" nanoiis

Now you can access via browser using container IP Address (ex.: ). Use here container IP.

Access via powershell:
Enter-PSSession <type-here-containerID> -RunAsAdministrator

If you want container starts everytime docker service starts:
docker update --restart=always <type-here-containerID>

How to manage Nano Server via remote PS:

Show docker images.

docker images

Add Nano Server Container + IIS (image) .

docker pull nanoserver/iis

Create a Windows Docker Container for Nano Server.

docker run --name nano -d -it -p 80:80 nanoserver/iis

Show container running.

docker ps -a -f status=running

Get Nano Server Container IP Address.

docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" nano

Script to create a remote interactive session from host to Nano Server Container.

$container= docker inspect --format="{{.Id}}" nano
$sesion = New-PSSession -ContainerId $container -RunAsAdministrator

Samples of remote scripts to run into a Nano Server Container. (Windows Update).

Search of updates not installed. You can change "IsInstalled=0" for "IsInstalled=1" if you want to see updates installed.

$WinUpdate = {
$ci = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession
$result = $ci | Invoke-CimMethod -MethodName ScanForUpdates -Arguments @{SearchCriteria="IsInstalled=0";OnlineScan=$true}
Invoke-Command -Session $sesion -ScriptBlock $WinUpdate

Apply Windows Updates not installed.

$WinUpdate = {
$ci = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession
Invoke-CimMethod -InputObject $ci -MethodName ApplyApplicableUpdates
Invoke-Command -Session $sesion -ScriptBlock $WinUpdate

Nano Server is a Microsoft product. Terms of use and official image base:

Hope you enjoy it. Rate, comment and share it. Thanks...


Docker Pull Command