Open ben3441 opened 11 months ago
Having multiple .devcontainer
folders in subfolders is currently not supported. You could move the two devcontainer.json to a top-level .devcontainer
folder with subfolders:
.devcontainer/frontend/devcontainer.json
.devcontainer/backend/devcontainer.json
You can keep the top-level frontend
and backend
folders. The devcontainer.jsons might need some adjustments, e.g., you can control the workspace folder inside the container with the "workspaceFolder"
property.
Ahh ok thanks I'll try that instead in general š.
Having multiple devcontainer.json files under different subfolders from the common .devcontainer folder at root when I try to open the dev container in vscode for example by going ctrl+shift+P >> 'Dev Containers: Open Folder in Container' I am prompted to select which container to pick from backend or front end.
I guess as this selection is required it isn't possible to fully automate the download and opening of a subproject of a repo as I am trying as the user would still have to make this selection? (still very nice functionality if this is the case) My badge is defined like so:
I can't see a way to specify which dev container to open here?
Thanks again for your help.
ofcourse the badge is just rendered in the comment above š¤¦āāļø. The bit doing the redirect and opening into the dev container is here: https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=git@gitlab.**somerepo**.git
We could add a folder
parameter to the URI to support opening subfolders. š¤
I have a setup like this: monorepo
In the README.md files I want to put 'open in dev container' badges like this: https://code.visualstudio.com/docs/devcontainers/create-dev-container#_add-an-open-in-dev-container-badge
However when I try this for example in the backend README.md the dev-container fails as it looks in the root of the repo for the dev-container definition files with logs like this: [4277 ms] Start: Run in container: cat /workspaces/monorepo/.devcontainer/devcontainer.json 2>/dev/null [4279 ms] Start: Run in container: cat /workspaces/monorepo/.devcontainer.json 2>/dev/null [4280 ms] Repository unknown-owner/componentcatalogue has no dev container files.
The same thing can be reproduced without the badge through ctrl+shift+P and then selecting 'Dev Containers: Clone Repository in Container Volume' and going through the steps there.
I'm not sure if I'm missing something or if this isn't supported? I couldn't find any documentation or similar issues on it.