testcontainers-java icon indicating copy to clipboard operation
testcontainers-java copied to clipboard

Add support for Compose V2

Open dboreham opened this issue 3 years ago • 2 comments

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).

dboreham avatar Apr 20 '22 16:04 dboreham

Hi @dboreham, it looks like it's currently in the works: https://github.com/testcontainers/testcontainers-java/issues/5596

aidando73 avatar Aug 26 '22 06:08 aidando73

The WIP PR is #5608. We are still considering different approaches to implementing the support since Compose V2 contains breaking changes.

kiview avatar Aug 26 '22 07:08 kiview

#5608 adds support to compose v2 which will be released in the next version.

eddumelendez avatar Jun 21 '23 03:06 eddumelendez