question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`DockerComposeContainer` does not work with local docker-compose v2

See original GitHub issue

Upgrading 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:open
  • Created 2 years ago
  • Reactions:6
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

14reactions
joachimglinkcommented, Dec 14, 2021

A workaround to get DockerComposeContainer working when docker compose v2 is enabled is to set withOptions("--compatibility");

1reaction
nicklasbondessoncommented, Oct 23, 2021

This is happening with all versions of Docker Desktop > 4.0.1 on macOS (Big Sur 11.6) as well.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found