Using docker-compose interpreter on \\wsl$\ project (Windows)

In windows I can open a project on \\wsl$\ path and can work on the code without any problems using PyCharm + PyCharm automatically gives me a linux bash in the terminal from where I can run my docker-compose services with WSL2 integration which is nice. For debugging I would like to use PyCharm. I know that I can not benefit from docker WSL2 integration when doing so since it is not supported by PyCharm, but I don't mind, because I do not need to debug that often. However, when trying to run a configuration using the docker-compose interpreter Docker fails with:

Invalid interpolation format for "volumes" option in service "xxx": "//wsl$/Ubuntu-20.04/home/user/xxx:/opt/project:rw"

Ofc this is because PyCharm by default tries to mount the project path to `/opt/project`. Since the absolute path is provided and seemingly is not correctly escaped ("\\wsl$\" should be escaped using "\\wsl$$\") Docker returns this error. 

As far as I know I can not provide the default mounting by my self to add correct escaping??

Are there any other "workarounds"?

Eventually it would be nice if this would get fixed.

11

I can confirm that with newest Intellij and Docker 2.4.0.0 I get exactly the same error! Is there any fix?

0

Experiencing the same issue

0

Hi all, 

There are significant changes expected in one of the future releases in WSL workflow, please follow up for the ticket  https://youtrack.jetbrains.com/issue/PY-43023  in order to be updated on implementation. 

0

Antonina Belianskaya - wrong URL: https://youtrack.jetbrains.com/issue/PY-43023  -"404 Nope, can't find it!"

0

6 months later with 2021.1.1 still not fixed

0

Está dando esse erro quando tendo usar o depurador

0

Hello, 

 

Nicolo Gasparini I am wondering what exactly does not work? 

 

Brenda Mendes, what version of the IDE you are running? 

 

Please submit an issue at https://youtrack.jetbrains.com/issues/PY  for a further investigation. 

0

The issue already exists and what's not working is a docker interpreter with files inside wsl storage
https://youtrack.jetbrains.com/issue/PY-46578

0

For those who might be interested I have created a small tool which I use to replace the erroneous paths in the generated tmp docker-compose.yml files.

https://github.com/cedriclevarlet/jbwsl2

0

请先登录再写评论。