<blockquote>
  <p>But if I have a simple app like a python hello world, what prevents this from running on both operating systems?</p>
</blockquote>

<p>It won't work in the same way that copying <code>/usr/bin/python</code> from a Linux machine to a Windows machine and using it to run your application doesn't work.</p>

<p>Docker isn't running the hello world script, it's running Python, which needs to be compiled for specific operating systems and architectures.</p>

CC BY-SA 4.0
2018-07-22T05:08:19.410Z
2018-07-22T05:08:19.410Z
user2640621
<p>You can run your Docker containers on all major platforms, but Docker on Windows and Mac runs your containers on a Linux VM. </p>

<p>It takes care of mapping volumes, ports etc. from your host machine to containers, so mostly you don't have to think about the VM layer. But you still have configure limits of VM resources (RAM, CPU etc.) and there might be adverse effects on performance.</p>

<p>I don't think you can run Linux-based Docker containers on a Windows machine directly without a VM (not taking WSL into account) as even a simple "hello world" app would use a Linux base image with Linux binaries, which cannot be run on a Windows machine without some kind of emulation or virtualization.</p>

<p>See: <a href="https://docs.docker.com/docker-for-windows" rel="nofollow noreferrer">https://docs.docker.com/docker-for-windows</a></p>

CC BY-SA 4.0
2018-07-21T11:12:50.380Z
2018-07-21T11:12:50.380Z
Yekta Leblebici
<p>I have read (and seen several online videos) that Linux containers can’t be run on windows and visa versa. It is my understanding that this is due to the fact that the container doesn’t contain a kernel and therefore it relies on the host kernel.</p>

<p>But if I have a simple app like a python hello world, what prevents this from running on both operating systems?</p>

<docker><containers>
Can a cross platform app be run as a container on both Linux and windows hosts?
Wings
# Can a cross platform app be run as a container on both Linux and windows hosts?

(Asked by: username_0 on 2018-07-21)

I have read (and seen several online videos) that Linux containers can’t be run on windows and visa versa. It is my understanding that this is due to the fact that the container doesn’t contain a kernel and therefore it relies on the host kernel.

But if I have a simple app like a python hello world, what prevents this from running on both operating systems?

**Tags:** docker, containers


---

## 2 answers

### Answer by username_1 on 2018-07-22. Score: 1

> But if I have a simple app like a python hello world, what prevents this from running on both operating systems?

It won't work in the same way that copying `/usr/bin/python` from a Linux machine to a Windows machine and using it to run your application doesn't work.

Docker isn't running the hello world script, it's running Python, which needs to be compiled for specific operating systems and architectures.


---

### Answer by username_2 on 2018-07-21. Score: 0

You can run your Docker containers on all major platforms, but Docker on Windows and Mac runs your containers on a Linux VM.

It takes care of mapping volumes, ports etc. from your host machine to containers, so mostly you don't have to think about the VM layer. But you still have configure limits of VM resources (RAM, CPU etc.) and there might be adverse effects on performance.

I don't think you can run Linux-based Docker containers on a Windows machine directly without a VM (not taking WSL into account) as even a simple "hello world" app would use a Linux base image with Linux binaries, which cannot be run on a Windows machine without some kind of emulation or virtualization.

See: <https://docs.docker.com/docker-for-windows>


---

