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

features not enabled for devcontainer started indirectly from docker compose #1175

Open
arafubeatbox opened this issue Nov 9, 2024 · 2 comments

Comments

@arafubeatbox
Copy link

arafubeatbox commented Nov 9, 2024

prerequisites

I have two devcontainers configured in a single repository, based on https://code.visualstudio.com/remote/advancedcontainers/connect-multiple-containers.

Both devcontainer.json files are pointed to a single docker-compose.yml, so when I create one of the devcontainers via vscode, the other also gets created. I switch between the containers during development using the Dev Containers: Switch Container vscode command.

Both devcontainers have their own features configured.

the problem

Only the container that I first create via vscode (which container to choose is irrelevant) has features enabled, and when I switch to the other container, it does not have any of the features enabled.

@gauravsaini04
Copy link
Contributor

Hi @arafubeatbox
Thank you for reporting this issue and providing the initial details. To better understand and debug the problem, could you please share a minimal reproducible example? Having a concise example will allow me to test the issue directly and provide a more effective solution.

@arafubeatbox
Copy link
Author

Hello @gauravsaini04
Thanks for looking into the issue.
Sorry it took a while to reach back to you.

Steps to reproduce

  1. Clone https://github.com/arafubeatbox/multi-devcontainers-with-feature-bug-test
  2. Open the folder in vscode
  3. Reopen the folder inside a container via vscode command palette (Dev Containers: Reopen in Container)
    • choose main-app as the container to open
  4. Check that main-app has node installed by executing node -v inside the container
    • node is configured as a feature inside .devcontainer/main/devcontainer.json
  5. Switch containers via vscode command palette (Dev Containers: Switch Container)
    • choose sub-app this time
  6. Executing node -v inside the sub-app container results in command not found: node
    • node is also configured as a feature for sub-app inside .devcontainer/sub/devcontainer.json, but is not installed

note

If you choose sub-app as the first container to open (the first container to create) in step 3, then the result would be the opposite: sub-app has node installed and main-app doesn't.
(Note that to get the opposite result, you first need to delete both devcontainers if you have them already created.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants