Deploying Docker Containers to Windows Server 2016

Posted: December 15, 2016 in Windows Server

First we need to install the OneGet PowerShell module and Docker itself:

Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
Install-Package -Name docker -ProviderName DockerMsftProvider


If You get error regarding missing KB3176936,installing that package won’t solve the problem.


Instead,we need to fully update Windows Server:





Press 6,then press A


Press A again



Now you should be able to install docker (run again)

Install-Package -Name docker -ProviderName DockerMsftProvider

See available Web server images:

docker search iis --no-trunc




I choose to install nanoserver/iis (about 300 MB against microsoft/iis 4 GB)

docker run -it -p 80:80 nanoserver/iis cmd

-i interactive Keep STDIN open even if not attached

-t  Allocate a pseudo-TTY

-p 80:80 map docker host port 80 (Windows Server) to container post 80,consider it as port mapping

cmd run Command prompt upon container start

I changed default IIS welcome page:

del C:\inetpub\wwwroot\iisstart.htm
echo "If you see this page,it means you have reached IIS test page running on IIS nano-server container.It's awesome :-)" > C:\inetpub\wwwroot\index.html

Try to access IIS container’s web page, is IP address of Windows Server (container host)



We can save this modified container for future use,first find out name of this container:

docker ps -a



Now save this image:

docker commit sharp_lalande modified-iis
docker images





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s