Docker Compose service suffix changed from `_1` to `-1`
See original GitHub issueHi,
I’m not sure when this change happened but it seems one of the latest docker-compose desktop version changed the suffix naming pattern for services from _1
to -1
This let’s my tests fail as the lookup doesn’t work anymore
564eae8ef285 zzsybrtief7r_pdf "docker-entrypoint.s…" ... 3000/tcp zzsybrtief7r-pdf-1
e8ddf410a42c zzsybrtief7r_dummy "/docker-entrypoint.…" ... 80/tcp zzsybrtief7r-dummy-1
Caused by:
org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
at app//org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
at app//org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:329)
... 106 more
Caused by:
org.testcontainers.containers.ContainerLaunchException: Could not create/start container
at app//org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:525)
at app//org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:331)
at app//org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
... 107 more
Caused by:
org.testcontainers.containers.ContainerLaunchException: Aborting attempt to link to container zzsybrtief7r_pdf_1 as it is not running
at app//org.testcontainers.containers.GenericContainer.applyConfiguration(GenericContainer.java:815)
at app//org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:365)
... 109 more
If I change my exposed service setting to -1
like this:
@Container
val pdf = DockerComposeContainer(...)
.withLocalCompose(true)
.withExposedService("pdf-1", 3000) // change from _1 to -1
.withBuild(true)
The error gets stranger:
...
ContainerLaunchException: Aborting attempt to link to container jjz1pmny2gn9_pdf-1_1 as it is not running
❯ docker-compose --version Docker Compose version v2.3.3
Docker Desktop Version `4.6.0 (75818)`
OS: MacBook Pro (16", 2021)
M1 Pro
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:6 (2 by maintainers)
Top Results From Across the Web
docker-compose image named: "prefix_%s_1" instead of "%s"
According to docker compose issue #745: By default, Compose bases the project name on basename of the directory compose commands are run from....
Read more >Compose specification - Docker Documentation
A Compose implementation creating resources on a platform MUST prefix resource names by project and set the label com.docker.compose.project . Project name can ......
Read more >Create a Dev Container - Visual Studio Code
Create a new docker-compose.yml (or make a copy of an existing one) that you use to develop a service. Extend your existing Docker...
Read more >Advanced network options in Windows | Microsoft Learn
Switch Embedded Teaming with Docker Networks ... already in use on the container host (i.e. a network adapter other than the one being...
Read more >Docker - Renovate Docs
1 -stretch as that would change the suffix. If this behavior does not suit a particular package you have, Renovate allows you to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok the change to
-1
happens whenUse Docker Compose V2
is enabled@govardhanaraoganji In Docker Desktop for Windows, this is a setting in their UI. I’d assume there is something similar on Mac.