Configuring PhpStorm with Docker Desktop + Windows 11 + WSL2

I'm not understanding why it works this way but when I installed Docker Desktop for Windows 11, it forced me to use WSL2.  Docker desktop created its own WSL2 installation titled “docker-desktop” and “docker-desktop-data”:

wsl -l -v
 NAME                   STATE           VERSION
* docker-desktop         Running         2
 Ubuntu-22.04           Running         2
 docker-desktop-data    Running         2

When I go to Open a new project in PHP storm (and even VS Code) they can only see the “Ubuntu-22.04” under the WSL option.  Why?

How are you guys setting up Docker Desktop to work with PHPStorm?  Is the only way to do it to install docker on the Ubuntu-22.04 WSL2 installation?  Then run docker from there?  I would much prefer to use the docker desktop application vs the command line… As it just easier than remembering all of the commands.

I was able to set it up and use “bind mounts” to be able to pass code to the docker containers but performance was horrible (2-5+ second page loads).  I switched to using “volumes” within docker which fixed performance problems (back to instant page loads) but then the problem is I cannot access my code because it lives within the “docker-desktop-data” wsl2 installation.

0

请先登录再写评论。