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

Hey! Found Florent’s article helpful? Looking to deploy a new, easy-to-manage, and cost-effective hyperconverged infrastructure?
Alex Bykovskyi
Alex Bykovskyi StarWind Virtual HCI Appliance Product Manager
Well, we can help you with this one! Building a new hyperconverged environment is a breeze with StarWind Virtual HCI Appliance (VHCA). It’s a complete hyperconverged infrastructure solution that combines hypervisor (vSphere, Hyper-V, Proxmox, or our custom version of KVM), software-defined storage (StarWind VSAN), and streamlined management tools. Interested in diving deeper into VHCA’s capabilities and features? Book your StarWind Virtual HCI Appliance demo today!