15

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?

chicks
  • 1,911
  • 1
  • 13
  • 29
nanonerd
  • 251
  • 1
  • 2
  • 3

2 Answers2

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. 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.

Tensibai
  • 11,416
  • 2
  • 37
  • 63
user2640621
  • 1,405
  • 9
  • 20
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!

Briansbum
  • 1,112
  • 9
  • 13