Curiously, WSL2 never worked well for me: for whatever reason the I/O performance was horrible (especially when bind mounting code in PHP containers for local development) and Hyper-V just worked way better. Plus, there was the fact that with Hyper-V I could control the total amount of resources allowed to Docker pretty easily, even if the RAM that was allocated was always taken up while running (dynamic memory allocation in Hyper-V never worked well for me anyways).
Either way, while I'm more than happy with Docker Desktop (my circumstances allow me to use it at no expense), there are also some promising projects out there that some of you might be interested in, provided that you want something more than just the CLI.
Did you have your code within WSL2, or outside of it?
I/O performance is horrible in the second case. It's recommended to have your projects within WSL2. I've personally just bookmarked my projects folder that's within WSL2 so I can access it from Explorer as well.
I wish I could do the opposite, to be honest. I like the Docker Desktop UI and all the command line utilities it auto-installs, but I want to use another Docker host like a VMware Workstation VM or even a remote machine. As of this writing you can just install Docker for Windows and disable a bunch of services + Hyper-V, and the CLI stuff can still work with other machines, but the desktop app just doesn't.
- You use less resources since you don't need a separate DD app running
- It's more close to the experience you'd have on a production server which wouldn't run DD
Cons (by not using DD):
- If you like having a UI, you won't have it
- You can't use Docker extensions if that's something you want
- You have to install Docker in each WSL 2 instance instead of checking a checkbox in the DD UI
Neutral (in either case):
- You can still access things on localhost without DD
- You can still run K8s directly in WSL 2 without DD using Kind and other tools
- Everything works the same, there's no limitations around Docker's core feature set
- Performance is really good (including volumes) as long as your files are in WSL 2's file system with or without DD
This option is interesting for organizations that cannot afford a monthly license for dozens of developers. Drawbacks... after working a couple of months I can say that time to time there are awful issues that came from nowhere, you need to mantain cleaning things in WSL constantly, so if the company can pay DD avoid the painful way
Thanks. I had looked at that reference originally too but it does a lot of things unrelated to running Docker on WSL 2 and overcomplicates running Docker.
Realistically getting Docker to run on WSL 2 involves running a few standard install steps from Docker for installing Docker and Docker Compose v2 on Linux (such as Ubuntu, Debian or whatever distro you prefer) and then adding a 3 line shell script to your ~/.profile to ensure the init.d based Docker service starts when your WSL 2 process starts -- that's it.
I've been running this set up for months, it's super solid.
I was under the impression that docker installed in windows would manage system resources better than inside a wsl commissioner. I use lando, a docker compose wrapper. It’s instructions say to install docker inside wsl, but also warns of stability issues.
You can also use docker desktop alternatives on the windows side such as Rancher Desktop or Podman Desktop. Both work similar to Docker desktop in how they integrate with WSL2, but unlike Docker Desktop both are free to use.
Strange, for me it mostly worked out of the box, only updating kernel was required. But I had huge issues with networking, VPNs just don't play well with WSL.
[+] [-] tester756|3 years ago|reply
Using Docker inside WSL 2 has been painful for years, that's nice to see that things are getting better.
[+] [-] KronisLV|3 years ago|reply
Either way, while I'm more than happy with Docker Desktop (my circumstances allow me to use it at no expense), there are also some promising projects out there that some of you might be interested in, provided that you want something more than just the CLI.
Podman Desktop: https://podman-desktop.io/
Rancher Desktop: https://rancherdesktop.io/
[+] [-] boredpudding|3 years ago|reply
I/O performance is horrible in the second case. It's recommended to have your projects within WSL2. I've personally just bookmarked my projects folder that's within WSL2 so I can access it from Explorer as well.
[+] [-] smileybarry|3 years ago|reply
[+] [-] kristianp|3 years ago|reply
[+] [-] nickjj|3 years ago|reply
Pros (for not using DD):
Cons (by not using DD): Neutral (in either case):[+] [-] jslakro|3 years ago|reply
[+] [-] jollyllama|3 years ago|reply
[+] [-] nickjj|3 years ago|reply
Realistically getting Docker to run on WSL 2 involves running a few standard install steps from Docker for installing Docker and Docker Compose v2 on Linux (such as Ubuntu, Debian or whatever distro you prefer) and then adding a 3 line shell script to your ~/.profile to ensure the init.d based Docker service starts when your WSL 2 process starts -- that's it.
I've been running this set up for months, it's super solid.
[+] [-] makeitrain|3 years ago|reply
[+] [-] jollyllama|3 years ago|reply
[+] [-] larrybud|3 years ago|reply
[+] [-] throw_me_5555|3 years ago|reply
[+] [-] maxloh|3 years ago|reply
[+] [-] zaps|3 years ago|reply
[+] [-] runjake|3 years ago|reply