Where you keep your code when using Docker on Windows

I'm about to install PhpStorm on Windows 10 Pro. My team uses Docker with Linux containers and I'm still struggling to set up Docker Desktop. I already have Ubuntu on WSL2 so I can run bash scripts.

Docker support documentation is great but I'm still very confused about the overall architecture of everything. Am I right if I understand that PhpStorm supports the scenario where I put my source code inside the Ubuntu virtual machine (physically located in a *.vhdx file in Windows host) and I use PhpStorm to edit it? If so, how does it work under the hood? Are files accessed in real time (using CIFS, NFS or something like that) or there's some sync process involved?

And... Is the performance gain worth the hassle? I'm currently using the Hyper-V backend because of a WSL2 bug that affects dockerised PHP.

0
2 comments

Long story short, you may create/open project directly on a WSL2 share (\\wsl$) and access your Ubuntu WSL file system. However, there were some known Microsoft issues with bad WSL share performance. Not sure if these affect your projects as well and as far as I may concern, there is a significant number of users holding their projects directly on WSL shares, so please feel free trying.  

1

I've unfortunately discovered that hosting your files in the Windows host is not even an option. If you use the WSL2 backend you hit this bug and file system breaks. If you use the Hyper-V backend you hit this bug and networking breaks. I'll try moving my files within \\wsl$ and see how it goes.

0

Please sign in to leave a comment.