You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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
.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!
fastapi-vscode-example/.devcontainer/Dockerfile
Line 28 in 715e6ea
The text was updated successfully, but these errors were encountered: