Mounted folder is empty when Cloned from Repo (works when opened from local files) #1502
Description
- VSCode Version: 1.68.0
- Local OS Version: Windows 10.0.19044
- Local chip architecture: arm64
- Reproduces in: Remote - Containers (codespaces untested)
- Name of Dev Container Definition with Issue: mongodb
I need to run a bash script in a container to initialize a mongo replica set. To do this I need to mount my .devcontainer folder to a mongodb setup container so it can run it. This works if I checkout the repo locally and then run "Rebuild and reopen in Container"
Here is a demo repository that the issue occurs for me:
https://github.com/jrj2211/vscode-remote-try-node-mongo-compose
When using VS Code to "Clone the repo into a container volume", this however does not work and the folder is empty.
I was expecting these would work the same, regardless if its a local source or pulled from git in a docker volume.
I imagine the first thing that happens is dev containers clone the git directory into a volume so I'm unsure why its not available in this way. In the "app" service once booted into the terminal, the files all exist in the /workspaces/vscode-remote-try-node-mongo-compose
directory.
I've also tried move this script into various directories. Even if you mount ..:/workspace
, id expect to see the test-project and .devcontainer folders in there but it too is empty. Mounting just the script itself also does not work.
I've been unable to find a workaround for this.
The documentation on his page makes it seem like this should be doable:
https://code.visualstudio.com/remote/advancedcontainers/add-local-file-mount