Can a Linux container run a Windows application, or the reverse?
IntermediateConceptContainers, VMs & Isolation Internals
Answer
No. Containers share the host kernel, so a Linux image needs a Linux kernel and a Windows image needs a Windows kernel. Docker Desktop on Mac/Windows runs a hidden Linux VM (or WSL2) to host Linux containers. Windows containers need a Windows host with matching build versions (process isolation) or Hyper-V isolation.
More on Containers, VMs & Isolation Internals
What is a container, in one sentence?BeginnerHow do containers differ from virtual machines?BeginnerWhat are Linux namespaces? Name the ones Docker uses.BeginnerWhat are cgroups and what do they do for containers?BeginnerWhat is PID 1 in a container and why does it matter?IntermediateHow do you see which namespaces a container uses and enter them from the host?Intermediate