3 ms·
> I thought it ironic recalling how many people had sold containers as lighter weight VMs that remove “works on my machine” hassles. Containers aren't VMs, the
by duped 3y ago
> I thought it ironic recalling how many people had sold containers as lighter weight VMs that remove “works on my machine” hassles.
Containers aren't VMs, they're Linux namespaces. If you want to run a container you need Linux. If you want to run Linux on MacOS you need virtualization. There's no "lightweight" VM about it - it's still a VM.
- 2OEH8eoCRo0 3y agoContainers are virtualization without the machine part.
- monocasa 3y agoWhen running Linux containers on Mac, the containers run within a full virtual machine.
- hiatus 3y agoDocker Desktop on Linux works this way, too.
- sleepybrett 3y agoWhile the machine part may not matter, the OS certainly does. Linux containers depend on the Linux kernel which is external to the container.
- packetlost 3y agoNo, they are not. Containers are namespaced process groups (CGroups) with a sandboxed filesystem and (optionally) sandboxed network layer via bridge interfaces and virtual devices.
- 2OEH8eoCRo0 3y agoWhat is virtualization to you? https://en.wikipedia.org/wiki/Docker_(software) https://en.wikipedia.org/wiki/Docker_(software) > Docker is a set of platform as a service products that use OS-level virtualization https://www.netapp.com/devops-solutions/what-are-containers https://www.netapp.com/devops-solutions/what-are-containers > Containers are a form of operating system virtualization.
- giantrobot 3y agoOn Windows and macOS Docker runs Linux in a VM and then all the containers attach to that VM. I think this has changed to WSL2 on Windows of late but it's still the case on macOS AFAIK.
- watermelon0 3y agoWSL2 is a Linux VM (albeit with some advanced features such as dynamic memory allocations, GPU & file sharing, etc.) on Windows hypervisor, and Docker for Windows just uses their own WSL2 VM. It also 'magically' exposes Docker socket to your own WSL2 instances/VMs.
- duped 3y agoWindows actually has some kind of native containerization but I believe it's based on virtualization and not an equivalent of namespaces on Linux. I'm not even sure if such a feature would make sense on Windows in the same way it does on Linux. But that's my point. It seems from this thread people don't understand what docker is except that they can kinda use it like a VM. But it's fundamentally different.
- gymbeaux 3y agoIt’s worth noting there are different kinds of containers out there, and Docker is just one “ecosystem”. Docker on Windows and macOS runs in a VM, which is kind of a bummer because it means you can’t really allocate all your RAM for containers. By default Docker likes to max out at half the system RAM, which of course you can change post-install, but I feel like there’s a trade off or disadvantage in such a scenario vs Docker (or LXC or podman or something else) running on Linux. It might be that the RAM is reserved up-front on Windows and macOS but not on Linux? I’m not sure.