Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Mounted folder is empty when Cloned from Repo (works when opened from local files) #1502

Open
@joezappie

Description

@joezappie
  • 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

image

When using VS Code to "Clone the repo into a container volume", this however does not work and the folder is empty.

image

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

Metadata

Metadata

Assignees

Labels

containersinfo-neededIssue requires more information from poster

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions