testcontainers/testcontainers-java · critical · InvalidConfigurationException
containers are currently not supported
Error message
%s containers are currently not supported
What it means
After picking a Docker strategy, Testcontainers pings the daemon and inspects its OS type. If the daemon reports an osType other than 'linux' (typically 'windows'), tryOutStrategy throws InvalidConfigurationException because Testcontainers only supports Linux containers. The thrown message is the OS type plus 'containers are currently not supported'.
Solutions
- Switch Docker Desktop back to Linux containers (system tray icon or `& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchLinuxEngine`)
- Point DOCKER_HOST at a Linux-capable daemon (remote Linux host, WSL2 backend)
- Verify with `docker info --format '{{.OSType}}'` that the daemon reports linux before running tests
Defensive patterns
Strategy: validation
Validate before calling
// Refuse to run against non-Linux daemons before starting containers
String osType = java.util.Optional.ofNullable(
new com.github.dockerjava.core.DefaultDockerClientConfig.Builder().build()
).orElse(null) != null ? null : null;
Process p = new ProcessBuilder("docker", "info", "--format", "{{.OSType}}").start();
String out = new String(p.getInputStream().readAllBytes()).trim();
if (!"linux".equals(out)) {
throw new IllegalStateException(out + " containers are not supported; switch Docker to Linux engine");
} Try / catch
try {
container.start();
} catch (InvalidConfigurationException e) {
if (e.getMessage().endsWith("containers are currently not supported")) {
// switch the daemon to Linux containers and rerun
}
throw e;
} Prevention
- Keep Docker Desktop in Linux-container mode on Windows dev machines
- Check `docker info --format '{{.OSType}}'` in CI pre-steps
- Use WSL2/remote Linux daemons where Linux containers are required
When it happens
Trigger: Running tests against a Docker daemon configured for Windows containers (Docker Desktop 'Switch to Windows containers'), so strategy.getInfo().getOsType() returns "windows" and the check `!osType.equals("linux")` fails.
Common situations: Docker Desktop on Windows left in Windows-container mode; CI agents with Windows-container daemons; a daemon reporting a blank/odd osType falls through with only a warning instead.
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
- is currently not supported
- Unexpected scheme
- Previous attempts to find a Docker environment failed. Will…
- Unknown transport type
- Invalid value for dockerconfig.source
AI-assisted analysis of testcontainers/testcontainers-java@8e549514e3 (2026-09-12).
Data as JSON: /api/errors/8607275c572a14c2.
Report an issue: GitHub.
Appendix: source
Thrown at core/src/main/java/org/testcontainers/dockerclient/DockerClientProviderStrategy.java:303
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();
String failureDescription;View on GitHub (pinned to 8e549514e3)