Alex-D / dotfiles

Windows + WSL 2 Ubuntu + Windows Terminal + zsh + systemd + p10k + Docker + IntelliJ IDEA + GitBash with zsh
196 stars 27 forks source link

No problems but some questions #3

Closed mcoiffier closed 3 years ago

mcoiffier commented 3 years ago

@Alex-D First of all thank you very much for your readme, I feel it's the most exhaustive on how to use Intelij, docker and WSL 2 😃 👍

I didn't find any problem, but I have some questions to understand how all the elements fit together.

  1. Why use docker desktop and not only docker from wsl2? For the container management GUI or for other things?

  2. Why run IntelliJ from WSL 2? Isn't there a way to access files placed in a docker container that is living on WSL 2?

  3. In which case is the WSL Bridge useful? Is it for instance when you run a server on WSL 2 and you want to see it on your browser from the Windows machine?

Thanks again !

Alex-D commented 3 years ago

Hey!

  1. Because it was not possible at the beginning of WSL 2, and I did not give it a try since I am not working with Docker on my current projects. So, maybe later :)
  2. I run IntelliJ inside WSL 2 because the network mount between Windows and WSL is very very slow. Also, if your libs are in WSL, IntelliJ will get access to it (eg: go, git, ...) so you do not need to configure them twice.
  3. Yep, I need the WSL Bridge to open ports and get access to servers running under WSL 2, from a browser on Windows, or from other computers on the same network for test purposes.

Hope it helps :)

Alex-D commented 3 years ago
  1. I've tried it, it works! I just need to add some tricks to start the Docker daemon automatically at startup.
Alex-D commented 3 years ago

I've managed to get systemd working on WSL2, making docker daemon starting by itself, and I did not need Docker Desktop anymore 🎉🎉🎉

mcoiffier commented 3 years ago

Great news ! To be honest I am still working on wsl1. At the moment I find it really tricky to set up such an environment to really take advantage of the performance of wsl 2...

Have you heard of WSLg? What do you think about it? Looks like we'll be able to do the job without our friend VcXsrv (https://devblogs.microsoft.com/commandline/the-initial-preview-of-gui-app-support-is-now-available-for-the-windows-subsystem-for-linux-2/)

Alex-D commented 3 years ago

Yep, I've checked WSLg :) I do not want to go Insider on my work computer, neither upgrading to Windows 11 for now.

I'm testing IntelliJ Idea on Windows connecting to WSL2, it works almost perfectly. I have issues with PHPStan and PHPCS since it's not yet compatible with WSL2 :(

VcXsrv does the job until WSLg ^^