Linux machine with docker deploy windows container
Asked Answered
G

1

39

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?

Geanticline answered 17/10, 2015 at 19:3 Comment(1)
Actually... this just might be possible today (Dec. 2016, 14 months later). See my revised answer.Plasmagel
P
41

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.

Plasmagel answered 17/10, 2015 at 19:18 Comment(18)
am i the only one that's interpreting the question as running a windows container on a Linux host docker engine.?Adinaadine
@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.Plasmagel
just trying to a devil's advocate here. The first sentence just says that a Linux container e.g. docker run -it <some-image> /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.Adinaadine
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?Imitate
@Imitate 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.Plasmagel
@Plasmagel 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?Imitate
@Imitate yes there is: stefanscherer.github.io/…: Docker for Windows Beta 26 on Windows 10Plasmagel
@Plasmagel Awesome! You saved my day! Going to test it on Windows Server 2016, otherwise I will fallback to W10. Thanks!Imitate
@Plasmagel 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?Imitate
@Imitate Yes, Docker for Windows Beta 26 was for Windows 10 only.Plasmagel
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.Aeneas
You can run a linux container on windows. Refer thenewstack.io/… for more detailsMichaelmichaela
@It'satrap that is not what the question is asking. It is asking about Windows container. Not Linux container.Plasmagel
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.Michaelmichaela
@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.Plasmagel
@It'satrap I have edited the answer to make my point clearer: stackoverflow.com/posts/33190605/revisionsPlasmagel
Worth noting that Microsoft has improved the network options for containers and now allows multiple containers per pod with improved namespace.Karankaras
@Karankaras Thank you. I have included your comment in the answer for more visibility.Plasmagel

© 2022 - 2024 — McMap. All rights reserved.