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

Remote development cannot abide multiple remote containers defined in compose files with the same service name running simultaneously #5716

Closed
extradosages opened this issue Oct 13, 2021 · 3 comments
Assignees
Labels
containers Issue in vscode-remote containers info-needed Issue requires more information from poster

Comments

@extradosages
Copy link

extradosages commented Oct 13, 2021

I have two different remote development environments. Each environment spins up a remote development container according to a docker-compose.yaml referenced in the devcontainer.json declaration. Both compose files specify the deployment of the container under a service called vscode.

Spinning up either on their own works fine. However, if one is running, vscode will fail to spin up the second. This is because instantiation attempts to find running instances of an environment with the following command:

[2021-10-13T21:42:29.404Z] Start: Run: docker ps -q -a --filter label=com.docker.compose.project=vscode --filter label=com.docker.compose.service=vscode
[2021-10-13T21:42:29.437Z] Stop (33 ms): Run: docker ps -q -a --filter label=com.docker.compose.project=vscode --filter label=com.docker.compose.service=vscode

which obviously can't tell the difference between the two containers.

The totality of the documentation that I have found on this subject is here: https://code.visualstudio.com/remote/advancedcontainers/connect-multiple-containers.

How can I add additional metadata to each of these declarations that will be used by remote containers to distinguish between the two? If I can't I would suggest that this is a bug-- that all projects shouldn't share the same implicit namespace for their services.

Environment details:

Version: 1.62.0-insider
Commit: 284e0db6c4cac1e557a43cd6691babdaafc2e1a9
Date: 2021-10-12T05:44:48.500Z
Electron: 13.5.1
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Linux x64 5.13.19-2-MANJARO
@extradosages
Copy link
Author

I have to wonder if this is the same issue as #5697.

@extradosages extradosages changed the title Remote development cannot abide multiple remote containers running defined in docker-compose.yaml with the same service name. Remote development cannot abide multiple remote containers defined in compose files with the same service name running simultaneously Oct 13, 2021
@github-actions github-actions bot added the containers Issue in vscode-remote containers label Oct 13, 2021
@chrmarti
Copy link
Contributor

Docker Compose derives the project name from the folder's basename which seems to be vscode in both your remote environments. Try renaming one of the folders or set COMPOSE_PROJECT_NAME with an .env file in one of the workspace folders. Does that help?

@chrmarti chrmarti self-assigned this Oct 18, 2021
@chrmarti chrmarti added the info-needed Issue requires more information from poster label Oct 18, 2021
@extradosages
Copy link
Author

extradosages commented Oct 18, 2021

It does. Excellent help, seems like this is more of a docker-compose thing than a vscode thing.
For those who are interested, here's a link to the relevant discussion in compose world: docker/compose#745 and in the compose spec world: compose-spec/compose-spec#206.

Thanks, @chrmarti .

@github-actions github-actions bot locked and limited conversation to collaborators Dec 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
containers Issue in vscode-remote containers info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants