Introduction to Windows Containers

 

I am very trhilled to write this article as i am a huge fan of Docker and PowerShell so, both of the two worlds are starting to works smoothly on Windows 2016 Server TP3. TP3 means Technical Preview 3, so for the moment, keep in mind that Windows Containers are not production ready, unlike PowerShell 5 which is.

I won’t do the presentation for Docker, if you don’t have heard about them, i sguggest you to opens qwant.com and read about it. It will help you in IT, because this is clearly THE thread everyone is talking about for 2 years at least.

First of all, let’s download a wim image of DataCenter Core server packaged for Windows Containers here: http://aka.ms/ContainerOSImage

Now, during the download, let’s have a look about how to run Windows Containers on Windows Server 2016 TP3.

01

The Feature is now installed, let’s take a look at what we have in the PowerShell module associated, because there is no GUI tools at the moment to manage your Containers, and this is awesome!

02

As you see, ce can do many intresting things 😀

Let’s have a closer look and start using a container. In order to do this we’ll need at first install the container OS Image.

This will enable the DataCenterCore image to be available for our containers, you can verify that using

04Now that the image is available, let’s build our container 🙂

05The Containet is now created, but not started, let’s use Start-Container to correct this

06

Ok, let’s add network connectivity to our Container 🙂

I noticed Add-ContainerNetworkAdapter cmdlet, so let’s have a look.

07Ok the network interface is added, but how can we get info about it ? The good old Get-Member to the help !

08

If you’re familiary with Hyper-V theses lines will get common for you

09So it seems a virtual switch is needed if we want to route traffic to/from our container !

11

After doing a Get-Help Set-ContainetNetworkAdapter, i got the feeling that the vswitch needed to be declarated when the Network adapter is added to the container. So let’s remove the previous one a create a new.

And add a new one with the correct switch and a dynamic Mac address… and connect it to the internal network !

Everything is OK ?

12

And now, connect it 🙂

13

Once again, administrators will have to go deeper inside their command line tools because everything is about PowerShell to manage containers. Which is fine for me ! Another thing, There is a lot of Hyper-v behind the scene, i don’t know if it’s a good thing or not, but this isn’t totally Docker like as i’d love too. We’re talking about a full OS at the moment and i hope one day, we’ll be able to launch applications 😀

Anyway, this is again a good move from Microsoft, like they have in the past 18 months 🙂