I have a Linux server with 16GB ram with docker host installed. I would like to deploy on it a Windows Server container. Is it possible? Anyone has just tried this solution?
-
Actually... this just might be possible today (Dec. 2016, 14 months later). See my revised answer. – VonC Dec 12 '16 at 20:00
1 Answers
Update 2019
As noted by duct_tape_coder in the comments:
Microsoft has improved the network options for containers and now allows multiple containers per pod with improved namespace.
In theory (original answer Oct 2015):
There is no "Windows container" running on a Linux host.
And a Linux container would not run directly on a Windows server, since it relies on system calls to a Linux kernel.
You certainly can run those Linux containers on any Windows machine through a VM.
That is what docker toolbox will install.
There will be support for docker on Windows soon, but that would be for Windows container, not Linux containers.
Update 2017: yes, LinuxKit allows to run a linux container through aa Hyper-V isolation wrapper on a Windows platform, through a minimal Linux OS built from linuxkit.
That is still the same idea: linux running inside a VM on Windows.
That is not a Linux server deployed on a Windows server: only deployed inside a Linux server running in a VM on Windows.
Actually... (update Dec. 2016)
See "Linux and Windows, living together, total chaos! (OK, Kubernetes 1.5)"
Kubernetes 1.5 includes alpha support for both Windows Server Containers, a shared kernel model similar to Docker, and Hyper-V Containers, a single-kernel model that provides better isolation for multi-tenant environments (at the cost of greater latency).
The end result is the ability to create a single Kubernetes cluster that includes not just Linux nodes running Linux containers or Windows nodes running Windows containers, but both side by side, for a truly hybrid experience.
For example, a single service can have PODs using Windows Server Containers and other PODs using Linux containers.
But:
Though it appears fully functional, there do appear to be some limitations in this early release, including:
- The Kubernetes master must still run on Linux due to dependencies in how it’s written. It’s possible to port to Windows, but for the moment the team feels it’s better to focus their efforts on the client components.
- There is no native support for network overlays for containers in windows, so networking is limited to L3. (There are other solutions, but they’re not natively available.)
The Kubernetes Windows SIG is working with Microsoft to solve these problems, however, and they hope to have made progress by Kubernetes 1.6’s release early next year.- Networking between Windows containers is more complicated because each container gets its own network namespace, so it’s recommended that you use single-container pods for now.
- Applications running in Windows Server Containers can run in any language supported by Windows. You CAN run .NET applications in Linux containers, but only if they’re written in .NET Core. .NET core is also supported by the Nano Server operating system, which can be deployed on Windows Server Containers.

- 1,262,500
- 529
- 4,410
- 5,250
-
2am i the only one that's interpreting the question as running a windows container on a Linux host docker engine.? – OK999 Aug 25 '16 at 17:02
-
@OK9999 No you are not. And the first sentence of this answer do address that: there is no such thing as a Windows container on a Linux, which means you only have Linux containers and... a Linux container would not run anything Windows in it. – VonC Aug 25 '16 at 17:04
-
just trying to a devil's advocate here. The first sentence just says that a Linux container e.g. docker run -it
/bin/bash cannot be deployed on a Windows host (which have the docker engine installed). You didn't educate us that the vice-versa is also true. – OK999 Aug 25 '16 at 17:38 -
I don't get, why isn't possibile to run a linux container inside windows docker engine? They are doing it right with Windows 10 and Hyper-V (I see a MobyLinuxVM in Hyper-V Manager) but not with Windows Server 2016, anyone known why? – Jamby Oct 04 '16 at 11:14
-
@Jamby Because Windows Server 2016 implements Docker *for* Windows, for running Windows images. It does not have by default a VM to run a Linux machine on which you could have docker to run Linux container. – VonC Oct 04 '16 at 11:22
-
@VonC I see, so at this moment there isn't a container engine that both runs Windows images and Linux images? Is it a technical issue or I will be able to run Linux images on Windows Server 2016 once out of beta of Docker for Windows? – Jamby Oct 04 '16 at 11:50
-
@Jamby yes there is: https://stefanscherer.github.io/run-linux-and-windows-containers-on-windows-10/: Docker for Windows Beta 26 on Windows 10 – VonC Oct 04 '16 at 11:54
-
@VonC Awesome! You saved my day! Going to test it on Windows Server 2016, otherwise I will fallback to W10. Thanks! – Jamby Oct 04 '16 at 12:05
-
@VonC Tried it, Docker for Windows beta cannot be installed on Windows Server 2016 at this moment. So to recap Docker server can: -On Windows < 10 1511 can run *only* Linux images (with docker-toolbox) -On Windows 10 >= 1511 can run both linux and windows images (with a daemon switch between), -On Windows Server 2016 it can run *only* Windows images. -On Linux host can run *only* Linux images. Is it correct? – Jamby Oct 04 '16 at 13:14
-
-
If docker can run binaries docker can run vm software, like qemu. I don't think it is not possible, simply it's not done yet. – m3nda Apr 16 '17 at 13:13
-
You can run a linux container on windows. Refer https://thenewstack.io/finally-linux-containers-really-will-run-windows-linuxkit/ for more details – It's a trap Sep 03 '17 at 14:21
-
@It'satrap that is not what the question is asking. It is asking about Windows container. Not Linux container. – VonC Sep 03 '17 at 14:52
-
Yes it is but you have clearly written that linux containers can't run inside windows vm. This may be true at the time you wrote your answer, but not anymore. – It's a trap Sep 03 '17 at 16:20
-
@It'satrap it still is, for the same reason. You would need an Hyper-V isolation wrapper on a Windows platform for your linux container to run. – VonC Sep 03 '17 at 16:29
-
@It'satrap I have edited the answer to make my point clearer: https://stackoverflow.com/posts/33190605/revisions – VonC Sep 03 '17 at 16:34
-
Worth noting that Microsoft has [improved the network options for containers](https://learn.microsoft.com/en-us/virtualization/windowscontainers/container-networking/architecture) and now allows multiple containers per pod with improved namespace. – duct_tape_coder Feb 21 '19 at 21:02
-
@duct_tape_coder Thank you. I have included your comment in the answer for more visibility. – VonC Feb 21 '19 at 22:23