5 ms·
Is that not the premise of docker?
by arijun 1y ago
Is that not the premise of docker?
- detaro 1y agono.
- rtkwe 1y agoNo it's the opposite, the entire premise of Docker over VMs is that you run one instance of all the OS stuff that's shared so it takes less resources than a VM and the portable images are smaller because they don't contain the OS image.
- dwaite 1y agoThe premise is containerization, not necessarily particular resource usage by the host running the containers. For hosted services, you want to choose - is it worth running a single kernel with a lot of containers for the cost savings from shared resources, or isolate them by making them different VMs. There are certainly products for containers which lean towards the latter, at least by default. For development it matters a lot less, as long as the sum resources of containers you are planning to run don't overload the system.
- rtkwe 1y agoThe VM option is relatively new and the original idea was to provide that isolation without the weight of a VM. Also I'm not sure that docker didn't coin the word containerization, I've alway associated it with specifically the kind of packaging docker provides and don't remember it being mentioned around VMs.
- pjmlp 1y agoOn Windows containers you can chose if the kernel is shared across containers or not, it in only on Linux containers mode that the kernel gets shared.
- WhyNotHugo 1y agoNope, docker uses the host's kernel, so there are zero additional kernels. On non-Linux, you obviously need an additional kernel running (the Linux kernel). In this case, there are N additional kernels running.
- quietbritishjim 1y ago> On non-Linux, you obviously need an additional kernel running (the Linux kernel). That seems to be true in practice, but I don't think it's obviously true. As WSL1 shows, it's possible to make an emulation layer for Linux syscalls on top of quite a different operating system.
- asveikau 1y agoAnd long before WSL, *BSD was doing this with the Linux syscall abi.
- paulryanrogers 1y agoWSL1 wasn't really a VM though? IIRC it was implementing syscalls over the Windows kernel.
- ongy 1y agoI think that's the point. You don't have to run the full kernel to run some linux tools. Though I don't think it ever supported docker. And wasn't really expected to, since the entire namespaces+cgroup stuff is way deeper than just some surface level syscall shims.
- quietbritishjim 1y agoIndeed, WSL1 isn't a VM. As I said, it's just: > an emulation layer for Linux syscalls on top of quite a different operating system. My point was that, in principle, it could be possible to implement Linux containers on another OS without using VMs. However, as you said (and so did I), in practice no one has. Probably because it's just not worth the effort compared to just using a VM. Especially since all your containers can share a single VM, so you end up only running 2 kernels (rather than e.g. 11 for 10 containers). That's exactly how Docker on WSL2 works.