5 ms·
Containers on anything other than Linux run in a Virtual Machine. Depending on the platform, you may or may not have hardware acceleration. It's either using th
by Art9681 3y ago
Containers on anything other than Linux run in a Virtual Machine. Depending on the platform, you may or may not have hardware acceleration. It's either using the software emulator (slow) or hardware acceleration. On the new M architecture, I believe Docker now supports Rosetta2 emulation via Apple's Hypervisor Framework so it is near native performance.
As far as Vagrant being faster than Docker, it's possible the qemu backend it uses was hardware accelerated and for whatever reason the Docker VM wasn't? Or perhaps you were using Docker Desktop which does take up a lot of compute capacity away? Try using the docker cli without docker desktop and see if it works better for you.
- hu3 3y agoJust a nit. Docker on Windows is near native-like performance, using WSL2. WSL2 even supports running Linux GUI applications and GPU passthrough.
- mattrick 3y agoWSL2 still runs in a VM so it has the performance implications of that, not that they usually end up being that significant (I have found that memory usage in WSL2 is usually ridiculously high, though). I think the support for Linux GUI applications is achieved by running an X server on the Windows side of things.
- hu3 3y agoFunny thing is that most of my stuff runs faster in WSL2 than Windows because it bypasses Windows built-in virus scanner.
- technojamin 3y agoWSL2 uses a Hyper-V virtual machine [1], which is a native hypervisor [2] and doesn't come with most of the performance costs of software VMs. [1] https://en.wikipedia.org/wiki/Hyper-V https://en.wikipedia.org/wiki/Hyper-V [2] https://en.wikipedia.org/wiki/Hypervisor#Classification https://en.wikipedia.org/wiki/Hypervisor#Classification