testcontainers-java
testcontainers-java copied to clipboard
Add support for Compose V2
In recent versions, DockerCo changed the way compose functionality is delivered. In place of the old docker-compose script, there is now a CLI extension for the main docker command, so compose is invoked with docker compose <stuff> rather than docker-compose <stuff>.
Testcontainers, when running local compose, is currently trying to exec docker-compose and so this fails on a system that has recent docker installed: https://github.com/testcontainers/testcontainers-java/blob/master/core/src/main/java/org/testcontainers/containers/DockerComposeContainer.java#L690
While it is possible to work around with a shell script named docker-compose that delegates to docker compose, it would be good if testcontainers worked out of the box with recent docker installations (note a bash alias does not work here).
Hi @dboreham, it looks like it's currently in the works: https://github.com/testcontainers/testcontainers-java/issues/5596
The WIP PR is #5608. We are still considering different approaches to implementing the support since Compose V2 contains breaking changes.
#5608 adds support to compose v2 which will be released in the next version.