Skip to content

DockerComposeContainer Bug: No way to enable local compose mode (fails on Docker Desktop for macOS)Β #543

@ShimonSte

Description

@ShimonSte

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions