Hey everyone! I'm working on some projects using Docker, both on Windows and WSL2. I'm wondering what the ideal setup would look like. Can I install all the Docker components in WSL2 and also keep Docker Desktop on Windows? I've heard mixed opinions about this—some say it can lead to conflicts, while others recommend just installing it in WSL2 because Windows has issues with Docker. I'm looking for a way to run Docker containers from both Windows and WSL2 without any hassle. I'm comfortable using the command line for this. Thanks for your help!
3 Answers
Some people suggest going as far as reformatting drives and installing Linux directly. Honestly, that’s pretty extreme for most use cases. WSL2 does a great job, and you don’t need that level of performance if you’re already multitasking between Windows and WSL.
I recommend removing Docker Desktop and just using Docker in WSL2. If you need a GUI, tools in VS Code like Docker extension or trying out Podman could be great alternatives.
I get that, but I still want to run Docker containers from Windows. Switching to just WSL means I can only use it there.
If you're running containerized apps from both Windows and WSL2, you can go with either option. Just install Docker Desktop on Windows, and it should work for both. If you're facing issues, let us know what’s happening, and we can troubleshoot together!
Thanks for the suggestion! I previously had Docker Desktop but ran into problems with "phantom dockers" when running containers from WSL. I've switched to using Docker only in WSL, but now I can’t start containers from Windows. Any tips?
Thanks for the perspective! I’m actually okay with WSL2; it’s been working well for me, and I don’t want to go to the lengths of dual booting since I also game on Windows.