vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

v0.365.0 (pre-release) changed default container name

Open taoqf opened this issue 1 year ago • 2 comments

  • VSCode Version: 1.89.0
  • Local OS Version: Debian 12
  • Remote OS Version: Debain 12
  • Remote Extension/Connection Type: Containers
  • Logs:

Steps to Reproduce:

  1. Reopen repo1 in container
  2. Wait until remote opened.
  3. Run docker ps, the output will be like this devcontainer-xxx-1,devcontainer-yyy-1
  4. Reopen repo2 in container
  5. Wait until remote opened.

If I changed to release version (v0.365.0), when I run docker ps, the container name will be like this:

repo1_devcontainer-xxx-1,repo1_devcontainer-yyy-1 for repo1

and

repo2_devcontainer-xxx-1,repo2_devcontainer-yyy-1 for repo2

And which is expected. If I changed to pre version, I will start no nore then 1 repo.

Does this issue occur when you try this locally?: Yes/No Does this issue occur when you try this locally and all extensions are disabled?: Yes/No

taoqf avatar May 09 '24 03:05 taoqf

0.365.0-pre-release picks up the project name from the docker-compose.yml's name property. Docker Compose does the same and the latest Dev Containers version contains a fix to also honor that property. (Also see https://docs.docker.com/compose/project-name/.)

chrmarti avatar May 10 '24 09:05 chrmarti

But I don't have name in compose.yml, then the container name will always be devcontainer.

taoqf avatar May 10 '24 10:05 taoqf

We detect the case where the name would be devcontainer (derived from the folder name .devcontainer) and change it to the parent folder's name followed by _devcontainer. Does that not work for you?

chrmarti avatar May 13 '24 07:05 chrmarti

Yes, it will do. Thanks.

taoqf avatar May 16 '24 09:05 taoqf

@chrmarti, it seems v0.367.0 (pre-release) act the same. btw, when extends auto update, it will change to pre-release version.

taoqf avatar May 30 '24 02:05 taoqf

Continuing in https://github.com/devcontainers/cli/issues/831. I missed our recent change broke our handling of the case when the .devcontainer folder makes the project name devcontainer.

chrmarti avatar May 30 '24 12:05 chrmarti

Fixed in Dev Containers 0.368.0-pre-release. Could you give that a try and let us know if this indeed fixes it? Thanks!

chrmarti avatar May 30 '24 18:05 chrmarti

v0.368.0-pre-release works fine, thanks!

taoqf avatar May 31 '24 00:05 taoqf