-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Devcontainer doesn't work on a folder mounted in WSL #10301
Comments
here is my devcontainer.json
i tried with workspace mount and wihtout.. |
Actually, I have inspected created devcontainer and see there that my source folder is something like And what is very interesting.
and this not
I honestly do not have any explanations why. |
OK a bit more updates: What I noticed - that if I use dockerfile directly - it's always mounting real path like /mnt/workspace .. However when I switched to compose - it started using the path So most likely this is the issue for docker itslef why it happens like this. |
So may be what can be improved for VS Code extension - do not resolve to real path the path which we use for binding the workspace in WSL if Dockerfile is used. |
Which path do you get for |
It depends.. if open from ~/path then is /home/myuser/path While at same time if I go to /mnt/wsl/path - it will be same folder Because of symlink. I think it should be possible to reproduce in any wsl since mnt/c is available everywhere |
I also found another problem. If docker compose is running only from symlinked folder ( which is most likely docker issue ) If I go to typescript debugging- all my links are broken and sourcemaps do not work - they all resolved against real path While if I go to real /mnt path - I can debug from that project, but cannot mount to docker 😞 |
What I noticed also, I added following section:
so in the container - it's always a real path, but docker uses different bound types when binding from symlinked folder . It's I described it also here: docker/for-win#14380 |
What could probably help is to use: ${localEnv:PWD} instead of ${localWorkspaceFolder}, but it doesn't work. always empty |
@chrmarti do you think it is possible to change the logic of localWorkspaceFolder and to use the actual host OS path, not resolved realpath? Or may be we can introduce one more variable to avoid regression issue. |
I having the same problem I would like my devcontainer.json to be
as I need it for orbstack and so, but on Windows it only works if I do:
But that workaround for windows, does than not work anymore in orbstack and others.... And I would like not to maintain two devcontainer files... |
This seems to be a Docker issue: docker/for-win#14380 |
Hi,
Let me please explain the situtation:
wsl --mount --vhd "$PSScriptRoot\ws.vhdx" --partition 1 --name workspace
/mnt/wsl/workspace/myapp
folder container starts but filetree is emptyHowever when I run a command like this:
all the files are shown, and changes in that folder are attracted in my workspace folder in WSL ( which is mounted vhdx )
So I make the assumption that something is wrong here with how VS code is binding this folder to a devcotnainer
The text was updated successfully, but these errors were encountered: