0

From what I understand, the container includes all dependencies to run, but all containers running on the same platform whether it's a VM, or bare-metal will share the underlying kernel.

I believe I read somewhere that in order to run linux containers on windows, the Docker client spins up a linux based VM, and runs the container in that.

But now I see that docker for windows runs linux containers natively (ie, without hyper-v).

My question is: How can an image that was built to run on linux run on a system that has a windows kernel?

This is the original source that my question arose from:

https://www.hanselman.com/blog/DockerAndLinuxContainersOnWindowsWithOrWithoutHyperVVirtualMachines.aspx

With the latest version of Windows 10 (or 10 Server) and the beta of Docker for Windows, there's native Linux Container support on Windows. That means there's no Virtual Machine or Hyper-V involved (unless you want), so Linux Containers run on Windows itself using Windows 10's built in container support.

I saw some similar questions, but they explained how a linux container runs on a windows platform by utilising a vm/hyper-v

How docker desktop runs linux containers on Windows machine

Does "Docker On Windows" launch a linux virtual machine?

Perhaps I didn't understand their answers, but from what I understood, it still seems like the linux container is sitting on-top of the windows kernel.

1 Answer 1

0

this is the magic of LCOW (https://github.com/linuxkit/lcow)

you are right to run a container the base KERNEL should be same , since container is just an abstraction , so to run a linux container on windows there are two options

  1. either use moby linux on hyperv and run containers there
  2. use lcow to run light weight linux vm for each container. (lcow)

https://learn.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/linux-containers

with WSL in windows in future we might be able to get a third method don't know if already someone is working on it .

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.