Recently we've been suggested to stop using Docker, so I've been on the lookout for alternatives. One of the biggest problems we have is that some of our in-house tooling is written with Windows as an afterthought, and so it's often easier to run things under WSL, then through Docker. But the double abstraction makes some of our apps extremely slow on those Windows machines. Does anyone know if something like Rancher/K3s is any better with this regard?
I'm pretty sure Docker on Windows is going to run in a VM no matter what. And it's worth noting that running on Docker does not have any significant performance difference to running on raw Linux in the same environment.
Hate to be "that guy" but if you want speed in a Linux environment then just run Linux ;). If you're really stuck with Windows and need Docker, I'd say try hyper-v, VMware, etc and see which is fastest.
> But the double abstraction makes some of our apps extremely slow on those Windows machines.
If you keep your files in WSL 2's file system Docker is extremely fast. It's nearly as fast as native Linux and even apps with thousands of files will reload web servers nearly instantly on file change using volumes.
Unless there's a way to share the files from Windows in to WSL, then I can't do that. We need to be able to edit the files from within Windows (people want their VSCode/Sublime Text/Notepad++). I've tried to tell them to get Linux machines or Mac's, but that doesn't work for everyone either.
I use VS Code's native integration with WSL. So VS Code runs as a native Windows app with nearly everything you'd expect, but the actual files being read/saved are inside WSL. Works great with Vagrant, Docker for Desktop, Git etc.
Yep, this works really well and for directly accessing files in WSL 2's file system from Windows, @lenova's sibling comment goes over that process.
To expand on that, I also have this path in my Windows explorer "Quick access" list: \\wsl$\Ubuntu-20.04\home\nick
It's a shortcut to my home directory inside of WSL 2 for quick access. It's useful in the cases where I want to drag / drop a photo or something from Windows into WSL 2's world.
For example, on Windows you'll likely use NTFS which is a slower file system than ext on Linux. Then, NTFS can be mounted in which isn't fast. So, filesystem operations though this in WSL are going to be slow.
This is just an example and may not be your setup.
Rancher Desktop uses WSL to run Kubernetes and containerd. This is similar in setup to Docker Desktop. So, if you have performance issues in one setup you're likely to have them in the other. And, it may be related to WSL and the VM than to either of these apps.