<p>Yeah go nuts, you can run whatever you want in the container so long as the host supports virtualisation and can run the docker binary!</p>

CC BY-SA 3.0
2017-10-11T13:42:37.763Z
still I think there are some details to running Windows/Linux containers, or?
Ta Mu
CC BY-SA 3.0
2017-10-11T14:00:44.387Z
I think you need LinuxKit as well but you end up with the same functionality that's available on Linux
Briansbum
CC BY-SA 3.0
2017-10-11T13:29:14.213Z
2017-10-11T13:29:14.213Z
Briansbum
<blockquote>
  <p>Does the Docker engine abstract away the OS such that this configuration will run both apps?</p>
</blockquote>

<p>No, it does not. Docker uses containerisation as a core technology, which relies on the concept of <em>sharing a kernel</em> between containers. If one Docker image relies on a Windows kernel and another relies on a Linux kernel, you cannot run those two images on the same OS.</p>

<p>When you install Linux Docker on Windows, you're actually setting up a Linux VM in Hyper-V, the LinuxKit details are <a href="https://blog.docker.com/2017/09/preview-linux-containers-on-windows/" rel="noreferrer">here</a>. You can open the Hyper-V console and see a VM called "MobyLinuxVM". There's a lot of work done to abstract this away from you e.g. the <code>docker</code> binary can connect to the Linux VM and run the same commands you're used to, networking between the host and VM tries to be seamless, volume mounting, etc. Ultimately it's not Docker that lets you run a Linux Docker image on Windows, it's just plain old virtualisation.</p>

CC BY-SA 3.0
2017-10-11T21:35:13.367Z
2017-10-11T21:51:46.463Z
2017-10-11T21:51:46.463Z
user2640621
<p>We currently use a Windows based server to host 2 VMs. One VM uses Windows with a Windows app and the other VM uses Linux with a Linux app. </p>

<p>Is the below scenario possible? </p>

<p>Bare server with Windows 2016 (no VMs). Install Docker engine. Install Windows app container. Install Linux app container. </p>

<p>Does the Docker engine abstract away the OS such that this configuration will run both apps? Meaning that the Docker engine works as an "interpreter" akin to how Java code can run on various OS's?</p>

CC BY-SA 3.0
2017-10-11T14:05:43.953Z
Details are [here](https://blog.docker.com/2017/09/preview-linux-containers-on-windows/), mainly you need a linux VM to run linux containers just to provide a linux kernel ... docker containers are isolated processes, so they need a host, the linuxkit is just that but integrated within the docker run command for ease of use.
Tensibai
CC BY-SA 3.0
2017-10-11T15:21:02.243Z
Shouldn't this be an answer?
Dan Cornilescu
CC BY-SA 3.0
2017-10-11T17:01:30.267Z
@Dan presently at the chef summit, I was a little short to write a correct answer :) so I just dropped a comment
Tensibai
CC BY-SA 3.0
2017-10-11T19:27:42.340Z
Not sure what your Windows app is doing, but you could also consider switching to dot net core since it's cross-platform. That way you can run everything on Linux.
frennky
<docker><containers><linux><windows><servers>
Does Docker allow containers to be OS agnostic?
nanonerd
# Does Docker allow containers to be OS agnostic?

(Asked by: username_0 on 2017-10-11)

We currently use a Windows based server to host 2 VMs. One VM uses Windows with a Windows app and the other VM uses Linux with a Linux app.

Is the below scenario possible?

Bare server with Windows 2016 (no VMs). Install Docker engine. Install Windows app container. Install Linux app container.

Does the Docker engine abstract away the OS such that this configuration will run both apps? Meaning that the Docker engine works as an "interpreter" akin to how Java code can run on various OS's?

**Tags:** docker, containers, linux, windows, servers

> **Comments:**
> **username_1**: Details are [here](https://blog.docker.com/2017/09/preview-linux-containers-on-windows/), mainly you need a linux VM to run linux containers just to provide a linux kernel ... docker containers are isolated processes, so they need a host, the linuxkit is just that but integrated within the docker run command for ease of use.  
> **username_2**: Shouldn't this be an answer?  
> **username_1**: @Dan presently at the chef summit, I was a little short to write a correct answer :) so I just dropped a comment  
> **username_3**: Not sure what your Windows app is doing, but you could also consider switching to dot net core since it's cross-platform. That way you can run everything on Linux.  

---

## 2 answers

### Answer by username_6 on 2017-10-11. Score: 11

> Does the Docker engine abstract away the OS such that this configuration will run both apps?

No, it does not. Docker uses containerisation as a core technology, which relies on the concept of *sharing a kernel* between containers. If one Docker image relies on a Windows kernel and another relies on a Linux kernel, you cannot run those two images on the same OS.

When you install Linux Docker on Windows, you're actually setting up a Linux VM in Hyper-V, the LinuxKit details are [here](https://blog.docker.com/2017/09/preview-linux-containers-on-windows/). You can open the Hyper-V console and see a VM called "MobyLinuxVM". There's a lot of work done to abstract this away from you e.g. the `docker` binary can connect to the Linux VM and run the same commands you're used to, networking between the host and VM tries to be seamless, volume mounting, etc. Ultimately it's not Docker that lets you run a Linux Docker image on Windows, it's just plain old virtualisation.


---

### Answer by username_4 on 2017-10-11. Score: 2

Yeah go nuts, you can run whatever you want in the container so long as the host supports virtualisation and can run the docker binary!

> **Comments:**
> **username_5**: still I think there are some details to running Windows/Linux containers, or?  
> **username_4**: I think you need LinuxKit as well but you end up with the same functionality that's available on Linux  

---

