Windows Server
In this article, I’ll explain to you how to start with this new role, on Windows Server 2016 TP5.

To start, you need to install the ContainerImage module on the server that will store containers:

ContainerImage module

Verify that your module is installed correctly:

ContainerImage module

Now, we will install the role Containers:

the role Containers

With the command Find-ContainerImage, you will have the list of all available images for container base:

command Find-ContainerImage

To install an image, use the following command:

 install image commandAdministrator Windows PowerShell

Administrator Windows PowerShellAdministrator Windows PowerShell

Verify that images are correctly installed:

Container Image

We will now create the network interface, in NAT mode, to give an internet access to containers:

Administrator Windows PowerShell

A NAT rule will be created automatically:


We will now create our first container, that will store an IIS website. Use the following commands:

Administrator: Windows PowerShell

Here, we will create a new container, add a port mapping to access to our future IIS website and, finally, we start this container. We’ll now install the IIS role. Connect to your container and launch the installation of the IIS role:

Administrator Windows PowerShell

You can now navigate to your new web server, on a container:

web server

I will do an image of this container, to have an IIS base. To start, stop the container, with the command Stop-Container -Name $containerNameIIS. We will now convert this container to do an image. Use the following command:

Container Image

We will create a new container, based on this new image. Use the following command :

IIS Windows Server

I’ll now deploy a custom ASP.NET MVC website. I created my site from visual studio 2015:

custom ASP.NET MVC website

ASP.NET project

I customized it:

ASP.NET customization

On the server who are stored containers, I created a shared folder, that I named Share and, where I copied resources of my custom website that I just created. I created a local user, that I added in the local administrator of the server. I shared this folder with this user:

Computer managment

Container Properties

File Sharing

Network folder

I’ll create a new container for this MVC website, because you need some specific features. Use the following commands to install all dependencies and to convert the container to an image:

Administrator: Windows PowerShell

The last step is to create a new container, based on the last image that we created, and to copy sources of our custom website in this container:

Administrator: Windows PowerShell

And, if I browse my website on port 8080, I have this result :

ASP.NET window

The movie version (in French) is available here:

Back to blog