Closed OmarOmeiri closed 2 years ago
@OmarOmeiri can you please share which version of Docker Compose you have installed by running docker-compose version
? It looks like Compose is generating images names with a hyphen when the devcontainer CLI is expecting Compose to generate the names with an underscore.
It looks like Docker Compose made a breaking change in 2.8.0, which was subsequently reverted in 2.9.0. This sounds related.
https://github.com/docker/compose/releases/tag/v2.8.0
⚠️ Warning notice ⚠️
This release introduced a breaking change via compose-go v1.3.0 and this https://github.com/compose-spec/compose-go/pull/294. Docker Compose will recreate new resources (networks, volumes, secrets, configs...) with new names, using a - instead a _ and try to connect/use to this new created resources instead of your existing ones! Please use Compose v2.9.0 instead
If you are on Compose 2.8.0, can you try updating to 2.9.0 and see if the issue is fixed?
For me this issue still exist with docker-compose 2.9.0. The trick with adding the image name solved this for now.
It looks like Docker Compose made a breaking change in 2.8.0, which was subsequently reverted in 2.9.0. This sounds related.
https://github.com/docker/compose/releases/tag/v2.8.0
⚠️ Warning notice ⚠️ This release introduced a breaking change via compose-go v1.3.0 and this compose-spec/compose-go#294. Docker Compose will recreate new resources (networks, volumes, secrets, configs...) with new names, using a - instead a _ and try to connect/use to this new created resources instead of your existing ones! Please use Compose v2.9.0 instead
If you are on Compose 2.8.0, can you try updating to 2.9.0 and see if the issue is fixed?
I'm actually using v2.9.0
@jkeech Seems like the revert was only for resources. -
will still be used as the default separator for container names from v2.8.0
and forwards according to https://github.com/docker/compose/pull/9700#issuecomment-1206395531 .
Container build breaks with:
The image is created successfully, but the script is calling
pull
andinspect
with the wrong image name. If I rundocker image ls
I get:So the image is being created with this name:
lullo_devcontainer-workspace
But the script calls:lullo_devcontainer_workspace
Replaces "-" with "_"Steps to Reproduce:
docker-compose.yml
devcontainer.json
UPDATE I've made it work by explicitly setting the image name in the
docker-compose.yml
, like:It is working, but sure looks like a bug to me.