package org.testcontainers.dockerclient;

import com.github.dockerjava.api.DockerClient;
import com.github.dockerjava.core.DockerClientBuilder;
import com.github.dockerjava.core.DockerClientConfig;

public class UnixSocketConfigurationStrategy implements DockerConfigurationStrategy {

    @Override
    public DockerClientConfig provideConfiguration()
            throws InvalidConfigurationException {
        DockerClientConfig config = new DockerClientConfig.DockerClientConfigBuilder().withUri("unix:///var/run/docker.sock").build();
        DockerClient client = DockerClientBuilder.getInstance(config).build();

        try {
            client.pingCmd().exec();
        } catch (Exception e) {
            throw new InvalidConfigurationException("ping failed");
        }

        LOGGER.info("Access docker with unix local socker");
        return config;
    }

    @Override
    public String getDescription() {
        return "unix socket docker access";
    }

}

package org.testcontainers.dockerclient;

import com.github.dockerjava.api.DockerClient;
import com.github.dockerjava.core.DockerClientBuilder;
import com.github.dockerjava.core.DockerClientConfig;

public class UnixSocketConfigurationStrategy implements DockerConfigurationStrategy {

    public static final String SOCKET_LOCATION = "unix:///var/run/docker.sock";

    @Override
    public DockerClientConfig provideConfiguration()
            throws InvalidConfigurationException {
        DockerClientConfig config = new DockerClientConfig.DockerClientConfigBuilder().withUri(SOCKET_LOCATION).build();
        DockerClient client = DockerClientBuilder.getInstance(config).build();

        try {
            client.pingCmd().exec();
        } catch (Exception e) {
            throw new InvalidConfigurationException("ping failed");
        }

        LOGGER.info("Accessing docker with local Unix socket");
        return config;
    }

    @Override
    public String getDescription() {
        return "local Unix socket (" + SOCKET_LOCATION + ")";
    }

}

Update log wording for Unix socket config strategy
Update log wording for Unix socket config strategy
