testcontainers/testcontainers-java · error

is currently not supported

Error message

{} is currently not supported

What it means

Testcontainers only supports Linux containers. When the Docker daemon reports an OS type other than 'linux' (effectively Windows containers), the strategy fails with InvalidConfigurationException ('X containers are currently not supported') and Testcontainers falls through to other strategies or aborts environment discovery.

Solutions

  1. Switch Docker Desktop back to Linux containers (right-click tray icon → 'Switch to Linux containers...', or `& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchLinuxEngine`).
  2. Point DOCKER_HOST at a daemon running Linux containers (e.g. a remote Linux host over tcp, or WSL2 backend).
  3. If you must test Windows containers, do it outside Testcontainers — it does not support Windows containers.
  4. On CI, ensure the runner's Docker daemon is configured for Linux containers (Linux runners, or Windows runners in Linux mode).

Example fix

// before (cmd on Windows host, in Windows containers mode)
// after
& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchLinuxEngine
# or target a Linux daemon:
set DOCKER_HOST=tcp://linux-build-host:2375
Defensive patterns

Strategy: validation

Validate before calling

// Fail fast with a clear message if the daemon runs Windows containers
String osType = java.util.Optional.ofNullable(System.getenv("DOCKER_HOST")).orElse("default");
Process p = new ProcessBuilder("docker", "info", "--format", "{{.OSType}}").start();
String result = new String(p.getInputStream().readAllBytes()).trim();
if ("windows".equalsIgnoreCase(result)) {
    throw new IllegalStateException("Docker daemon is in Windows containers mode; Testcontainers needs Linux containers. Switch to Linux containers.");
}

Try / catch

try {
    new GenericContainer(DockerImageName.parse("alpine:3")).start();
} catch (InvalidConfigurationException e) {
    throw new IllegalStateException("Switch Docker Desktop to Linux containers (or point DOCKER_HOST at a Linux daemon): " + e.getMessage(), e);
}

Prevention

When it happens

Trigger: tryOutStrategy calls strategy.getInfo().getOsType() and the connected daemon's osType is 'windows' (any non-linux, non-blank value), so InvalidConfigurationException is thrown during getFirstValidStrategy.

Common situations: Developers on Windows with Docker Desktop switched to Windows containers mode; CI agents running Windows container daemons; accidentally pointing DOCKER_HOST at a Windows-containers daemon.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of testcontainers/testcontainers-java@8e549514e3 (2026-09-12). Data as JSON: /api/errors/eeab51f3b27c801a. Report an issue: GitHub.

Appendix: source

Thrown at core/src/main/java/org/testcontainers/dockerclient/DockerClientProviderStrategy.java:302

            if (!strategy.test()) {
                log.debug("strategy {} did not pass the test", strategy.getClass().getSimpleName());
                return false;
            }

            strategy.info = strategy.getDockerClient().infoCmd().exec();
            log.info("Found Docker environment with {}", strategy.getDescription());
            log.debug(
                "Transport type: '{}', Docker host: '{}'",
                TestcontainersConfiguration.getInstance().getTransportType(),
                strategy.getTransportConfig().getDockerHost()
            );

            log.debug("Checking Docker OS type for {}", strategy.getDescription());
            String osType = strategy.getInfo().getOsType();
            if (StringUtils.isBlank(osType)) {
                log.warn("Could not determine Docker OS type");
            } else if (!osType.equals("linux")) {
                log.warn("{} is currently not supported", osType);
                throw new InvalidConfigurationException(osType + " containers are currently not supported");
            }

            if (strategy.isPersistable()) {
                TestcontainersConfiguration
                    .getInstance()
                    .updateUserConfig("docker.client.strategy", strategy.getClass().getName());
            }

            return true;
        } catch (Exception | ExceptionInInitializerError | NoClassDefFoundError e) {
            @Nullable
            String throwableMessage = e.getMessage();
            @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
            Throwable rootCause = Throwables.getRootCause(e);
            @Nullable
            String rootCauseMessage = rootCause.getMessage();

View on GitHub (pinned to 8e549514e3)