microsoft / microsoft/vscode-remote-release

Shared Docker host: Distinguish between running containers by more than just local path

Open
#2,677 1 comment 2 reactions 1 assignee View on GitHub

@chrmarti is already working on this.

Since Apr 1, 2020.

bug containers plan-review
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.