`DockerComposeContainer` does not work with local docker-compose v2
See original GitHub issueUpgrading the host’s docker-compose to v2 (as it just happened on Manjaro stable) breaks testcontainers compose module
if .withLocalCompose(true) is set.
I 2021-10-08T21:26:58,503 🐳 [docker-compose] Container br9dj5ov1knh-my-image-1 Started [Thread-1]
I 2021-10-08T21:26:58,508 🐳 [docker-compose] Docker Compose has finished running [main]
I 2021-10-08T21:26:58,916 ?.7.3.4-r0] Creating container for image: alpine/socat:1.7.3.4-r0 [main]
E 2021-10-08T21:26:58,945 ?.7.3.4-r0] Could not start container [main]
org.testcontainers.containers.ContainerLaunchException: Aborting attempt to link to container ttytbebgfezl_my-image_1 as it is not running
at org.testcontainers.containers.GenericContainer.applyConfiguration(GenericContainer.java:812) ~[testcontainers-1.16.0.jar:?]
at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:363) ~[testcontainers-1.16.0.jar:?]
at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:329) ~[testcontainers-1.16.0.jar:?]
OS: Manjaro Linux Compose version: Docker Compose version 2.0.1
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Testcontainers DockerComposeContainer with Docker ...
One workaround that seems to work is to pass the compatibility option to the docker compose command. Like:
Read more >Using DockerComposeContainer with a local image does not ...
Hi there, I am just trying out TestContainers to launch a container with Atlassian Confluence inside which I know it works when using...
Read more >Docker Compose Module - Testcontainers for Java
When Docker Compose is used in container mode (not local), it's needs to be made aware of Docker settings for private repositories. By...
Read more >Compose file version 2 reference - Docker Documentation
Running id inside the created container shows that the user belongs to the mail group, which would not have been the case if...
Read more >Overview | Docker Documentation
Compose works in all environments: production, staging, development, testing, as well as CI workflows. It also has commands for managing the whole lifecycle ......
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

A workaround to get DockerComposeContainer working when docker compose v2 is enabled is to set
withOptions("--compatibility");This is happening with all versions of Docker Desktop > 4.0.1 on macOS (Big Sur 11.6) as well.