DockerComposeContainer always uses containerized mode, no way to enable local compose
Problem
DockerComposeContainer in testcontainers-scala 0.44.x always uses containerized Docker Compose mode, which fails on Docker Desktop for macOS.
The Scala wrapper always passes the image parameter to the Java constructor:
new JavaDockerComposeContainer(image, identifier, composeFiles...)
In testcontainers-java 2.x, this constructor does not set localCompose = true. Only the constructors without DockerImageName enable local compose mode:
// testcontainers-java ComposeContainer.java
public ComposeContainer(File... composeFiles) {
this(DEFAULT_IMAGE_NAME, Arrays.asList(composeFiles));
this.localCompose = true; // only set here
}
Since there's no way to enable local compose mode via testcontainers-scala, Docker Compose tests fail on Docker Desktop for macOS with:
ContainerLaunchException: Container startup failed for image docker:latest
Environment
- testcontainers-scala: 0.44.1
- testcontainers-java: 2.0.3
- Docker Desktop for macOS