Windows containers
Understanding windows docker container on Windows 10
Running Docker Containers on Window Server 2019
Windows 11 docker image?
Videos
I've been debating over publishing this or not in this channel, but recently I have seen a rise in negative comments when people come asking about Windows containers. Moderators: Feel free to remove the content if outside of the channel rules.
The goal here is twofold: First, I want to provide a set of links and notes to people starting to use Windows containers. Second, open the debate with people that have a negative view on Windows containers.
Links and Notes:
-
General documentation:
All information about Windows containers is available here: Containers on Windows documentation | Microsoft Learn
-
Install Containers on Windows:
First, keep in mind that Windows and Windows Server are different OSs with different purposes. Windows client (such as Windows 10 or 11) are focused on development and testing. Docker Desktop is the best option here for Windows containers. Windows Server (such as Windows Server 2019 and 2022) are focused on production scenarios. Docker CE/Moby will give you the best transition from Windows client, but containerd is the "the facto" container runtime for production. All information you need to install the options above are available here: Prepare Windows operating system containers | Microsoft Learn
Note: Hyper-V is only required for Docker Desktop on Windows client. It is used for Windows containers only when you run with hypervisor isolation. For Windows Server it is not required, unless you want that isolation mode.
-
Why Windows containers:
First of all, Windows containers are not competing with Linux containers. Windows containers are better than Windows VMs. Windows containers are being used by companies that usually have the following requirements:
-
Existing/Legacy application written in .Net Framework (or another framework) that is only supported in Windows and is now being considered for modernization. For many customers, re-writing the application to .Net Core is not an option or too costly. Windows containers come in handy. This is the case of many customers featured here: Microsoft Customer Stories Search (This includes XBox's Forza 5 and Microsoft Office 365)
-
Application dependency on Windows only components/requirements.
-
Ops/Infra team support for Windows only environment.
So, if you ask me today: Is Windows containers a proven technology that can be adopted for production workloads, my answer is yes. If you ask me: Should I use Windows containers even if I have the option to use Linux containers, then my answer is not immediately yes. I'd ask questions around the requirements listed above and let me be honest here: If you are writing a new application today and have no reasons to use Windows, then don't. Now, if you are in one of the buckets above, why would you have a large footprint of a Windows VM when you can have a Windows container?
Look, Linux containers have been established in the industry much faster than Windows, of course. They are smaller, they have a larger eco-system of tools available, they definitely have higher market-share. Now, if you have a dependency on Windows, there's no reason not to move to Windows containers. Windows containers are smaller than Windows VMs, they are faster than Windows VMs, in most cases they will have better density (resulting in lower costs overall), and also allow you to move to a modern platform that enables other advantages like DevOps practices, etc. So, the next time a question on Windows containers comes up, keep in mind the goal is to get a better platform for the Windows app, not compete with or compare to Linux.
With all this said - I'd love to get constructive feedback on how we can make Windows containers better.
Well, yes, you can run containers with Windows. Microsoft even provides official container images, but don't expect them to be as versatile as Linux images. I don't have any experience with them because I didn't have any use for it yet. From what I gathered you need a Windows host to run the containers, they don't run on Linux hosts (please correct me if I'm wrong here). You won't have a desktop either. If you manage to rdp into it (which I doubt is possible) you will get a command shell at most. The containers are meant to run powershell scripts or applications without gui, nothing more.
is it possible to configure a docker container to run Windows
Yes, you can Run native Windows Server Containers
connect to it via RDP
Nope.
According to an answer, Windows Containers does not support RDP. To quote an article from 2019:
But notice you still cannot RDP into such Windows containers.
See What's new for Docker on Windows Server 2019?