Skip to content
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

Incorrect workspace copy, causing host/container repo sync issue #1

Open
shreyansp opened this issue Aug 17, 2022 · 0 comments
Open

Comments

@shreyansp
Copy link

Thanks for sharing this example. There is one mistake in it though. It took me a couple hours to figure out, using this example, why my git repo in devcontainer was not in sync with that on my host. It's because of your last line COPY . /workspace.

I thought the whole point of dev containers is that so the workspace from your host and container is shared (by mounting it), not copied!

The dev container docker image that Microsoft provides, mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}, creates a mount correctly, but then I guess your COPY command overwrites this and creates a static snapshot view of the repository from the host at the point in time when the image is created.

Removing this line fixes everything. Thank you!

COPY . /workspace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant