Skip to content

Commit dbc68b3

Browse files
committed
Honor checks.disable in Docker detection test
When checks.disable is set to true, skip the socket connectivity test in DockerClientProviderStrategy.test(). This allows Windows/WSL2 users with working Docker to bypass the failing socket test while still enabling Docker detection. Fixes #4958 - TestContainers cannot detect Docker on Windows/WSL2 despite Docker being accessible via CLI and TCP. The socket connectivity test fails on Windows/WSL2 even when Docker is accessible via curl and CLI. By honoring the existing checks.disable configuration, users can opt out of the connectivity test and rely on their explicit docker.host configuration.
1 parent 3878311 commit dbc68b3

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

core/src/main/java/org/testcontainers/dockerclient/DockerClientProviderStrategy.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ public DockerClient getClient() {
154154
*/
155155
@UnstableAPI
156156
protected boolean test() {
157+
// Skip connectivity test if checks are disabled (useful for Windows/WSL2)
158+
if (TestcontainersConfiguration.getInstance().isDisableChecks()) {
159+
log.debug("Checks are disabled, skipping Docker connectivity test");
160+
return true;
161+
}
162+
157163
TransportConfig transportConfig = getTransportConfig();
158164
URI dockerHost = transportConfig.getDockerHost();
159165

0 commit comments

Comments
 (0)