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

Can't select the DevContainer definition when using multiple definitions in one repo #10435

Closed
OneCyrus opened this issue Nov 1, 2024 · 8 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers verified Verification succeeded volume Dev Container mounting a Docker volume
Milestone

Comments

@OneCyrus
Copy link

OneCyrus commented Nov 1, 2024

  • VSCode Version: 1.95.0
  • Local OS Version: Windows 11
  • Remote OS Version: Ubuntu 22.04
  • Remote Extension/Connection Type: Containers
  • Logs: not sure where I could find a log related to this flow/process.

Steps to Reproduce:

  1. CTRL+SHIFT+P: DevContainers: Clone Repository in Container Volume
  2. Select a repository with multiple DevContainer definitions
  3. I would expect the prompt to select the definition. But it auto-selects the default/root devcontainer definition. This used to work perfectly before

Does this issue occur when you try this locally?: it's a feature of the remote extension
Does this issue occur when you try this locally and all extensions are disabled?: it's a feature of the remote extension

@OneCyrus
Copy link
Author

OneCyrus commented Nov 1, 2024

basically this seems to be broken: devcontainers/spec#6

@vs-code-engineering vs-code-engineering bot added the containers Issue in vscode-remote containers label Nov 1, 2024
@chrmarti chrmarti added bug Issue identified by VS Code Team member as probable bug volume Dev Container mounting a Docker volume labels Nov 1, 2024
@chrmarti
Copy link
Contributor

chrmarti commented Nov 1, 2024

Giving the choice upfront is harder in this case because the repository isn't initially cloned yet, so the configurations are not on the local machine yet.

I will fix the F1 > Dev Containers: Switch Container command available while already connected to the dev container to unblock this.

@chrmarti chrmarti added this to the November 2024 milestone Nov 1, 2024
@chrmarti chrmarti closed this as completed Nov 1, 2024
@chrmarti
Copy link
Contributor

chrmarti commented Nov 1, 2024

This is now available in Dev Containers 0.390.0-pre-release. You still need to connect to the main dev container first, but you can then use F1 > Dev Containers: Switch Container to connect to the other configurations. Please give that a try and let me know if that works for you. Thanks.

@OneCyrus
Copy link
Author

OneCyrus commented Nov 2, 2024

@chrmarti I'm pretty sure this exact scenario was working before. It used to clone the repository in the bootstrap container and then was asking to select the DevContainer config. It was a deferred prompt until the extension actually knew the content of the repo.

Not sure when this actually changed/broke. I need to try again with older vscode/extension versions.

@chrmarti
Copy link
Contributor

chrmarti commented Nov 4, 2024

There is another prompt when there is no devcontainer.json at all that will let you pick from the list of configuration templates. That should still work. From the issue description above, you did not seem to refer to that though.

@OneCyrus
Copy link
Author

OneCyrus commented Nov 4, 2024

May be I mixed it up with a remote SSH connection and then "reopen in devcontainer" where the prompt appears.

@pl4nty
Copy link

pl4nty commented Nov 22, 2024

this is still broken in v0.391.0-pre-release

  1. clone a new repo
  2. devcontainers only searches for .devcontainer.json and .devcontainer/devcontainer.json
  3. prompted to create a devcontainer.json because "none exists"
  4. when container is ready, I use Dev Containers: Switch Container to swap to my intended container in .devcontainer/python/devcontainer.json

@chrmarti
Copy link
Contributor

@pl4nty That's the current solution/workaround. If you need the prompt when connecting for the first time, please open a new feature request.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers verified Verification succeeded volume Dev Container mounting a Docker volume
Projects
None yet
Development

No branches or pull requests

4 participants