-
Notifications
You must be signed in to change notification settings - Fork 305
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
Docker compose remote container project name issue #498
Comments
The problem we were fixing here is that if the devcontainer.json is in the We could add a config option for the project name to the devcontainer.json or look into letting I'd like to avoid Toolbox-specific fixes since that is not supported. |
More configuration options is definitely a winner, being able to set the project name in the devcontainer.json would be great. |
You have some indirect control over it: As a workaround you could move your docker-compose.yml to a subfolder (or the main folder). We only add the |
Got bitten by this too right now. Two completely separate projects, each with their However, the Remote Container extension doesn't pay attention to the .env file and the COMPOSE_PROJECT_NAME environment variable, so it fires both projects up with the project name "source". After that, things go downhill right away - e.g. in the file explorer both project windows show the same content, and both project windows are obviously attached to the same project's container, instead of separate containers. The Remote Containers really has to take into account the configured project names, otherwise it's pretty unusuable without ugly workarounds like moving Just fixing #222 should solve the project name issue once and for all.. |
Fixing with #222 |
I know what this issue is, what causes it, and what is required to fix it, though this issue does relate to Docker Toolbox it appears to be a relatively minor change.
I believe recently a change was made to the Remote Container extension, somewhere in the last week or two that added an underscore to the project name on docker-compose.
On Windows, Docker Toolbox installs version 1.20.1 of docker-compose, and in this version the only characters supported in the project name are alphanumerics. The extension appears to use the project name of the current directory + "_devcontainer" e.g. "currentdirectory_devcontainer", which causes the process that creates the container to wait forever after creating the container, the "Creating ContainerName ... done" bit.
It's waiting for an event from the project name specified earlier, "currentdirectory_devcontainer" but any unsupported characters are stripped out of the project name, so this event never comes, what does come however is an event for "currentdirectorydevcontainer".
The fix is to remove the underscore, though as the code isn't open source, I can't speak of the impact this might have for anything else. If the underscore was added for nothing functional, there is a minor win for Docker Toolbox users.
A workaround temporarily is to allow the process to hang after creating the container, close the code-insider window, open another code-insider window and instead attach to the running container.
This would probably happen regardless of OS, version of insiders, specifics of the project, etc. The key players would be the docker-compose version (1.20.1~) and likely anything after version 0.53.0 / 0.54.0 of the Remote - Containers extension.
Hopefully there is enough information here to assist anyone currently experiencing this issue, and to pinpoint the exact location / version this issue came from.
The text was updated successfully, but these errors were encountered: