public static DockerClientProviderStrategy getFirstValidStrategy(List<DockerClientProviderStrategy> strategies) {
        if (FAIL_FAST_ALWAYS.get()) {
            throw new IllegalStateException(
                "Previous attempts to find a Docker environment failed. Will not retry. Please see logs and check configuration"
            );
        }

        List<String> configurationFailures = new ArrayList<>();
        List<DockerClientProviderStrategy> allStrategies = new ArrayList<>();

        // Manually enforce priority independent of priority property of strategy
        allStrategies.add(new TestcontainersHostPropertyClientProviderStrategy());
        allStrategies.add(new EnvironmentAndSystemPropertyClientProviderStrategy());

        // Next strategy to try out is the one configured using the Testcontainers configuration mechanism
        loadConfiguredStrategy().ifPresent(allStrategies::add);

        // Finally, add all other strategies ordered by their internal priority
        strategies
            .stream()
            .sorted(Comparator.comparing(DockerClientProviderStrategy::getPriority).reversed())
            .collect(Collectors.toCollection(() -> allStrategies));

        Predicate<DockerClientProviderStrategy> distinctStrategyClassPredicate = new Predicate<DockerClientProviderStrategy>() {
            final Set<Class<? extends DockerClientProviderStrategy>> classes = new HashSet<>();

            @Override
            public boolean test(DockerClientProviderStrategy dockerClientProviderStrategy) {
                return classes.add(dockerClientProviderStrategy.getClass());
            }
        };

        return allStrategies
            .stream()
            .filter(distinctStrategyClassPredicate)
            .filter(DockerClientProviderStrategy::isApplicable)
            .filter(strategy -> tryOutStrategy(configurationFailures, strategy))
            .findFirst()
            .orElseThrow(() -> {
                log.error(
                    "Could not find a valid Docker environment. Please check configuration. Attempted configurations were:\n" +
                    configurationFailures.stream().map(it -> "\t" + it).collect(Collectors.joining("\n")) +
                    "As no valid configuration was found, execution cannot continue.\n" +
                    "See https://java.testcontainers.org/on_failure.html for more details."
                );

                FAIL_FAST_ALWAYS.set(true);
                return new IllegalStateException(
                    "Could not find a valid Docker environment. Please see logs and check configuration"
                );
            });
    }
Determine the right DockerClientConfig to use for building clients by trial-and-error.

@return a working DockerClientConfig, as determined by successful execution of a ping command
core/src/main/java/org/testcontainers/dockerclient/DockerClientProviderStrategy.java