Guide to Docker containers on Windows Server 2016

Docker containers, which were already taking the market by storm, received a big boost in September when the company announced a commercial partnership with Microsoft. The deal, which extends the Docker engine to Windows Server, is expected to double the size of the already fast-growing container market.

Understanding containers

If you’re reading this, chances are you already understand what Docker containers are. If so, feel free to skip ahead to see what this means for you and how to run the containers in Windows. But for Docker newbies, here’s some background information.

Docker launched just three years ago in 2013, but it has already become immensely popular. One of the reasons containers got such widespread support so immediately was because a company is able to put many more applications into a physical server with containers rather than with virtual machines (VMs).

Essentially, this is because VMs use much more system resources, such as RAM and CPU cycles. While a container essentially only needs a compatible operating system and supporting programs, libraries, and resources, a VM needs much more.

Virtual machines must virtually replicate the system hardware to run. But because containers use shared operating systems instead of virtualizing hardware, you can put many more applications on one server using containers.

Not only this, but containers also create an operating system that is consistent among machines and can be used for development, testing, and deployment.

Of course, this isn’t to say that they are better than virtual machines. They are simply for different purposes. When using Docker, every container has to use the same operating system and kernel. Simplified, containers are for you if you need multiple copies of the same application.

There are a few reasons why Docker skyrocketed quickly and has steadily remained one of the top container companies. Docker changed the way containers were deployed, making it safer and easier.

With Docker, it’s possible to create different environments like that of a live server for development purposes and allow those on different computers to work on the same project, without needing to change the settings or spend hours setting up the environment yourself.

Docker notes that “On average, Docker users ship 7X more software after deploying Docker in their environment.” Also, with Docker, it’s easy to “identify issues, isolate the problem container, quickly roll back to make the necessary changes, and then push the updated container into production. Isolation between containers makes these changes less disruptive than in traditional software models.”

Docker containers in Windows Server 2016

dockerbuildlargeNow that you’ve got a good grasp of what Docker containers are (or you already knew), let’s see what that means for Windows users.

Before this, Docker containers were exclusive only to Linux. With this new partnership, though, they will be functional on the upcoming Windows servers. And what could be better than being able to run Docker containers on your Windows computer? Running it for free!

After two years of joint engineering, this commercial partnership entails a few specific things. First, the Commercially Supported Docker Engine, or “CS Docker Engine,” will be available to Windows Server 2016 customers for no additional cost.

Resolving some users’ issues with Docker support, Microsoft will provide Windows Server 2016 customers enterprise support for CS Docker Engine, backed by Docker Inc.

dockerdatacenterAdditionally, Docker and Microsoft will jointly assist in providing more security by promoting Docker Datacenter. This will help “IT Pros to secure the Windows Server software supply chain and manage containerized Windows Server workloads, whether on-prem, in the cloud, or hybrid,” Docker says.

The partnership also includes the integration of Visual Studio Tools for Docker and Docker for Windows. This gives developers complete desktop development environments for building Dockerized Windows apps.

Microsoft has also contributed Windows Server container-base images and apps to Docker Hub to jumpstart app development, according to Docker’s site. And, for IT pros, Docker Datacenter has made it possible to manage Windows Server environments in addition to the Linux environments it already manages.

The Docker platform “represents a single set of tools, APIs and image formats for managing both Linux and Windows apps.” As Docker’s Michael Friis puts it, “As Linux and Windows apps and servers are dockerized, developers and IT-pros can bridge the operating system divide with shared Docker terminology and interfaces for managing and evolving complex microservices deployments both on-prem and in the cloud.”

How to use the new Docker containers on Windows

There are a few things to understand about how to run the containers on Windows. The command “docker run” is available natively on Docker for Windows, and the terminology hasn’t changed much between the operating systems. Also, like different security profiles can be run on Linux, this is also true of Windows.

There are two isolation modes available, according to Docker’s website:

  1.  “Windows Server Containers use the same shared-kernel process-isolation paradigm known from Linux. Since containers run as normal (but isolated) processes, startup is fast and resource overhead is minimal.”
  2. “With Hyper-V isolation, container processes run inside a very minimal hypervisor created during container start. This yields potentially better isolation at the cost of slower startup and some resource overhead.”

So, a Windows container image can be run using either of these isolation modes, as long as the underlying host supports the requested isolation mode. Additionally, both of these hosts are able to be run at the same time, and the Docker control API is the same for both modes.

Generally, developers won’t have to worry about this and can simply use the typical “docker run” command, not needing the extra “docker run –isolation=hyperv microsoft/nanoserver”. Isolation mode is useful for IT pros, though, to decide how to deploy containerized apps in production.

Docker clarifies that “while Hyper-V is the runtime technology powering hyper-v isolation, hyper-v isolated containers are not Hyper-V VMs and cannot be managed with classic Hyper-V tools.”

For more information, there’s are some great tutorials on building Windows container imagesunderstanding the internals behind bringing Docker containers to Windows, Windows containers documentation, and almost everything else you need to know.

Photo credit: Docker

About The Author

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top