DEV Community

Cover image for What should I know about windows container?
Bahman Nikkhahan
Bahman Nikkhahan

Posted on • Updated on

What should I know about windows container?

In this post, I assume you have a basic understanding of containers.

Why windows containers

I think the first question that you need to ask yourself is why do you want to use Windows containers? Containers are a better fit for Linux compared to Windows and not every feature that you expect to use in Linux containers exist in Windows containers (at the time of writing this post). However, there could be instances that you have an application that needs Windows to run and you still want to benefit from containerisation.

If you made up your mind to use Windows containers, here are the things which you need to know:

Isolation Modes

If this is the first time that you are going to work with Windows containers, you need to know about their isolation modes. Windows containers have 2 isolation modes, "Process" and "Hyper-V". You can read more about them here. But in short, process isolation mode is useful when your containers are going to share the same host OS. However, Hyper-V isolation mode is useful when you want your containers to have their own virtual machine and their own OS. Hyper-V isolation mode can give you a more secure option and also more flexibility when it comes to choosing the host OS version, but it could affect the performance.

One other thing to consider is that not all cloud providers support Hyper-V isolation modes. For example, Azure and AWS don't support it yet (at the time of writing this post).

Base Images

There are multiple windows images that you can use to build your windows container. If you have a .Net framework application which you want to containerise, you probably want to choose Windows Server Core base image.
If you want to use a different build of Windows base image for your host machine and containers, you should first check this page out. If you are going to choose process isolation mode, you have limited flexibility when it comes to Windows builds.

Windows containers limitation

  • Windows containers are introduced with Windows Server 2016. So it is not available for older versions of Windows.
  • Version compatibility is another limitation which I mentioned above.
  • At the time of writing this post, cloud providers are catching up on Windows containers and their offerings are not as mature as their Linux containers
  • There is better community support on Linux containers compared to Windows containers.
  • If you use container orchestration tools like Kubernetes, you'll need to have Linux vms in your setup as well, so you'll end up with a hybrid approach.
  • Windows base images are bigger in size compared to the Linux ones.

Top comments (0)