Search
StarWind is a hyperconverged (HCI) vendor with focus on Enterprise ROBO, SMB & Edge

WS2016: Start with Windows Containers

  • September 16, 2016
  • 5 min read
Cloud and Virtualization Architect. Florent is specializing in public, hybrid, and private cloud technologies. He is a Microsoft MVP in Cloud and Datacenter Management and an MCSE in Private Cloud.
Cloud and Virtualization Architect. Florent is specializing in public, hybrid, and private cloud technologies. He is a Microsoft MVP in Cloud and Datacenter Management and an MCSE in Private Cloud.

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:

NetNat

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: https://channel9.msdn.com/Blogs/MVP-Cloud-DataCenter/Windows-Container-avec-Windows-Server-2016-TP5

Found Florent’s article helpful? Looking for a reliable, high-performance, and cost-effective shared storage solution for your production cluster?
Dmytro Malynka
Dmytro Malynka StarWind Virtual SAN Product Manager
We’ve got you covered! StarWind Virtual SAN (VSAN) is specifically designed to provide highly-available shared storage for Hyper-V, vSphere, and KVM clusters. With StarWind VSAN, simplicity is key: utilize the local disks of your hypervisor hosts and create shared HA storage for your VMs. Interested in learning more? Book a short StarWind VSAN demo now and see it in action!