Container name doesn't take into account the id-label
I build from two folders:
mybuild/target1/module/ mybuild/target2/module/
The same docker container is used for both, the above uses docker-compose, I would have expected that since the path is different the container name would also be.
It seems that the docker-compose project name is identical for both, so one of them fails to be created.
I would expect the devcontainer to pass by default different project-name using a hash from the workspace-folder + the idlabels.
I would also expect the container-name itself to include the idlabels as part of the hash and not just the workspaceFolder.
Hi 👋
I would also expect the container-name itself to include the idlabels as part of the hash and not just the workspaceFolder.
'id-label': { type: 'string', description: 'Id label(s) of the format name=value. These will be set on the container and used to query for an existing container. If no --id-label is given, one will be inferred from the --workspace-folder path.' },
Yes, currently with 'id-label' one can query for a container, but I don't believe it is used by container name creation. However, you make a very good point of using it for simpler distinguishing between containers.
// cc @chrmarti
We try to stick to Docker Compose's default behavior here which is to use the basename of the docker-compose.yml's folder. (One exception is when that is the .devcontainer folder where we add the parent folder's basename to the project name.)