-
Notifications
You must be signed in to change notification settings - Fork 304
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
Multiple container support for multi root workspaces #1460
Comments
Any news on this feature, please? |
I think I have another use case for this feature request. For example, I would like to have a repo which contains cross-platform code (e.g. code that is built for 3 major platforms: Windows, Linux, Mac). If a developer syncs the code on a Mac machine, it would allow building on the Mac container. If he/she syncs on a Windows machine, then it would allow building on the Windows container.. and so on.
This would also require support for Windows and Mac containers: |
The opensource community is moving into monorepo style for the last couple of years already, currently don't see any way to use this. How can you use VSCode Remote Code Development due to use cases described below? Thanks |
@XBeg9 It's important to separate general use cases with mono repos from this specific request. Certainly monorepos are popular in certain OSS circles, but that should not be blocked by this in most cases. So, let's get a better understanding of what you are trying to do to make sure there isn't another feature request beyond this one. To be clear, when cloned locally, you can absolutely have sub-folders in a monorepo that you open in a container and these folders can depend on other things in the broader source tree. (Even if you just use a In your example, would an individual developer be running 21 containers locally at once and would want to connect to all of them at the exact same time from a single VS Code window? Remote - Containers is also released, are you referring to Codespaces? |
@Chuxel thanks for the detailed answer. Yea, probably I mess around with Codespaces and Remote - Containers (release status).
That's exactly what I referring to, is there a way to run single VSCode UI with multiple devcontainers? |
@Chuxel I've seen that documentation and got so confused, in a title it says |
@XBeg9 This is referring to how one would spin up multiple Docker Compose managed containers that need to run at the same time for the application to work and develop each of them concurrently. To recap what is possible in Remote - Containers, you can spin up a bunch of containers using the same docker-compose.yml and open individual ones with unique devcontainer.json contents (E.g. extensions) in separate VS Code windows. You can do this whenever you need to work with a given container in the set, not just right away. That's what is described in the link above. You can even have scenario specific docker-compose.yml files if needed - just use a different starting folders for the first thing you open. Unfortunately, Codespaces does have some limitations around monorepos currently that prevent it from doing this, but that team knows about the issue. So, if you were trying it there, you're totally right that there's not way to do it yet (which is why I'd asked given your description). That is tracked here if you want to upvote / comment there: https://github.com/MicrosoftDocs/vscodespaces/issues/206 Now, shared libraries / modules is an interesting use case for Remote - Containers. There's a couple things here:
Otherwise, yes, you'd be running separate windows if neither of these two apply or would work. |
I wrote an article that might help us with multi-container and multi-root workspaces debugging simultaneously in a single VSCode Window: https://ikshitijsharma.medium.com/seamless-multi-container-multi-root-workspaces-debugging-in-vscode-devcontainers-on-steroid-54d7cff4ff77 |
@kshitijcode I'm totally in favor of the idea. But, why I need something in addition to systemd? I need systemd to configure networks, run containers , for deployment and maintenance. The recent shift is the replacement init with systemd in OCI containers. Systemd faithfully serves me even in WSL. |
+1 |
+1 would be a very handy feature for web apps that typically have a frontend and backend dev container |
+1
|
@Chuxel pls advise was anything done on this request since last time. Having a multi-root workspace with following structure:
why it's not possible just to right-click on VSCode only allows a single-folder layout when searching for I need to do curious tricks by putting p.s.: i know about https://code.visualstudio.com/remote/advancedcontainers/connect-multiple-containers and Firstly you have to run "Run Dev Containers: Open Folder in Container..." (which opens a system file dialog to select a folder again), after that when Container View opens you can switch back only to folder view (all your workspace layout is lost) |
My team and I are finding ourselves needing support for multiple dev containers in a single project as well. I would also be very interested in progress made here. To share our use case, our project's default devcontainer uses a docker compose file to bring up a set of support containers that serve as interfaces in place of the real services. We have a second docker compose that brings up a smaller subset, defined different url envs and whose networks are set to host mode. This second environment allows the container to run its tests against real systems that are available from this host (ie physically connected or accessible via tailscale subnet routers). Since there is no support for multiple containers, we need to manually change the compose file name being used when in the second scenario. Earlier today, I forgot to change the file and it launched the default compose file on the host in the second environment which spun up a docker network with the same subnet as the host's main network interface and dropped the box off the internet until someone could get on the machine to remove the docker network. |
I'd like to share our current setup, which works reasonably well with multiple containers. Our application is a web application with a nodejs front and backend set up in a mono repo. We set up a compose file in the root of our workspace. The compose file contains 3 services, the frontend, the backend and a postgres server with a testing database. The |
ref: #387
Currently, multi root workspaces with remote container just allows us to open via single container.
I'd like to propose support to open container per directory.
Let's say we have a monorepo which has backend API and frontend.
monorepo.code-workspace is like the following:
And when we run
Open Workspace in Container
, both backend container and frontend container start as defined in backend/devcontainer.json and frontend/devcontainer.json individually.The text was updated successfully, but these errors were encountered: