Over a million developers have joined DZone.

Docker on Windows Server 2016 (Part 2)

DZone's Guide to

Docker on Windows Server 2016 (Part 2)

Follow along to learn how how to configure Docker on a Windows 2016 virtual machine.

· Cloud Zone ·
Free Resource

Learn how to migrate and modernize stateless applications and run them in a Kubernetes cluster.

This blog is part of a multi-part series. The first part showed how to set up Windows Server 2016 as a VirtualBox VM. This second part will show how to configure Docker on Windows 2016 VM.

Start an elevated PowerShell session:docker-windows-2016-22 Run the script to install Docker:

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

This will install the PowerShell module, enable containers feature and install Docker.

docker-windows-2016-23The VM needs to be restarted in order for the containers to be enabled. Refer to Container Host Deployment – Windows Server for more detailed instructions.

The VM reboots. Start a PowerShell and check the Docker version using docker version:

docker-windows-2016-24More details about Docker can be found using the docker info command:


Run your first Docker container using the docker run -it -p 80:80 microsoft/iis  command:

docker-windows-2016-26This will download the Microsoft IIS server Docker image. This is going to take a while so please be patient!Once the 8.9 GB image is downloaded (after a while), the IIS server is started for you. Check the list of images using the docker images command and the list of running containers using the docker ps command:

docker-windows-2016-27More details about the container can be found using the docker inspect command:

The exact IP address of the container can be found using the command:

docker inspect --format '{{ NetworkSettings.Networks.nat.IPAddress }}' cocky_mahavira

The IIS main page is accessible at http://<container-ip>, as shown below:docker-windows-2016-28

The next part will show how to create your own Docker image on Windows Server 2016.

Join us in exploring application and infrastructure changes required for running scalable, observable, and portable apps on Kubernetes.

docker ,cloud ,windows server 2016 ,vm

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}