3 ms·
I don't understand why one needs to emulate a virtual machine to run a container. Why do you need a kernel? Why emulate physical devices, interrupts and everyth
by codedokode 4y ago
I don't understand why one needs to emulate a virtual machine to run a container. Why do you need a kernel? Why emulate physical devices, interrupts and everything else? Why cannot one run a container as a protected mode application?
- sneak 4y agoBecause containers are at their heart a shorthand term for a bunch of Linux kernel features that do not exist on other OSes.
- anthk 4y agoContainers are just fancy Linux chroots. So you need a Linux OS.
- marwis 4y agoYou don't and that's the idea behind gVisor.
- pmontra 4y agoAdding to other answers, not only containers of the docker and LXC/D types are Linux things that need a Linux kernel but often the software inside the container must be deployed and run on a Linux host. Often the build is done on a Linux server in a CI system and not on developers machines but developers do have to run that software too, kind of by definition.
- saagarjha 4y agoIt’s difficult to emulate a kernel. You can try and there have been multiple attempts to do so with varying levels of success but most have pitfalls that people eventually run into.