Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions core/src/main/java/org/testcontainers/DockerClientFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@
import org.testcontainers.dockerclient.TransportConfig;
import org.testcontainers.images.RemoteDockerImage;
import org.testcontainers.images.TimeLimitedLoggedPullImageResultCallback;
import org.testcontainers.utility.ComparableVersion;
import org.testcontainers.utility.DockerImageName;
import org.testcontainers.utility.MountableFile;
import org.testcontainers.utility.ResourceReaper;
import org.testcontainers.utility.TestcontainersConfiguration;

import java.io.InputStream;
import java.net.URI;
Expand Down Expand Up @@ -248,39 +246,9 @@ public void close() {
throw e;
}

boolean checksEnabled = !TestcontainersConfiguration.getInstance().isDisableChecks();
if (checksEnabled) {
log.debug("Checks are enabled");

try {
log.info("Checking the system...");
checkDockerVersion(version.getVersion());
} catch (RuntimeException e) {
cachedClientFailure = e;
throw e;
}
} else {
log.debug("Checks are disabled");
}

return client;
}

private void checkDockerVersion(String dockerVersion) {
boolean versionIsSufficient = new ComparableVersion(dockerVersion).compareTo(new ComparableVersion("1.6.0")) >=
0;
check("Docker server version should be at least 1.6.0", versionIsSufficient);
}

private void check(String message, boolean isSuccessful) {
if (isSuccessful) {
log.info("\u2714\ufe0e {}", message);
} else {
log.error("\u274c {}", message);
throw new IllegalStateException("Check failed: " + message);
}
}

private boolean checkMountableFile() {
DockerClient dockerClient = client();

Expand Down
1 change: 0 additions & 1 deletion docs/features/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ If any keys conflict, the value will be taken on the basis of the first value fo
Before running any containers Testcontainers will perform a set of startup checks to ensure that your environment is configured correctly. Usually they look like this:
```
ℹ︎ Checking the system...
✔ Docker version should be at least 1.6.0
✔ File should be mountable
✔ A port exposed by a docker container should be accessible
```
Expand Down