microsoft / microsoft/vscode-remote-release
Shared Docker host: Distinguish between running containers by more than just local path
@chrmarti is already working on this.
Since Apr 1, 2020.
- Dominant language
- Dockerfile
- Stars
- 4.2k
- Forks
- 470
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
When multiple users are runing dev containers on the same docker host, and when dev containers are running and you attempt to reconnect to your dev container without rebuilding, you may get the wrong container.
As described in #2456 , Remote uses the absolute path of the repo containing your devcontainer.json, on your local machine, as some kind of key to determine the correct container to connect to.
If you and your colleagues clone that repo to the same path on each person's machine, you can end up connecting to your colleague's dev container and working in their workspace folder.
In #2456 I fixed this by changing the local path - anything unique in the absolute path is sufficient.
I don't know what the constraints are. But, to offer a suggestion, perhaps the image hash could be used instead? When the user selects "reopen in container", and the image is not found on the docker host, then a picker should be shown which includes all discovered containers with the same image name, and also an option to rebuild.
I recognise that some people may develop on different machines and may want to nonetheless consistently connect to the same container. I don't think that Remote should rely on the absolute path in that case either. That use case has "Attach Visual Studio Code" as an option, though.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.