diff --git a/pom.xml b/pom.xml
index bee178a6d..3f9caa55a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
com.github.docker-java
docker-java
jar
- 3.0.1-SNAPSHOT
+ 3.0.0-kostyasha-3
docker-java
https://github.com/docker-java/docker-java
diff --git a/src/main/java/com/github/dockerjava/api/command/DockerCmdExecFactory.java b/src/main/java/com/github/dockerjava/api/command/DockerCmdExecFactory.java
index ae090e434..0de3afe38 100644
--- a/src/main/java/com/github/dockerjava/api/command/DockerCmdExecFactory.java
+++ b/src/main/java/com/github/dockerjava/api/command/DockerCmdExecFactory.java
@@ -3,8 +3,6 @@
import java.io.Closeable;
import java.io.IOException;
-import javax.net.ssl.SSLContext;
-
import com.github.dockerjava.core.DockerClientConfig;
import com.github.dockerjava.core.RemoteApiVersion;
@@ -117,8 +115,6 @@ public interface DockerCmdExecFactory extends Closeable {
DisconnectFromNetworkCmd.Exec createDisconnectFromNetworkCmdExec();
- DockerCmdExecFactory withSSLContext(SSLContext sslContext);
-
@Override
void close() throws IOException;
diff --git a/src/main/java/com/github/dockerjava/core/DefaultDockerClientConfig.java b/src/main/java/com/github/dockerjava/core/DefaultDockerClientConfig.java
new file mode 100644
index 000000000..4641f9d3c
--- /dev/null
+++ b/src/main/java/com/github/dockerjava/core/DefaultDockerClientConfig.java
@@ -0,0 +1,455 @@
+package com.github.dockerjava.core;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+import java.net.URI;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
+
+import com.github.dockerjava.api.exception.DockerClientException;
+import com.github.dockerjava.api.model.AuthConfig;
+import com.github.dockerjava.api.model.AuthConfigurations;
+import com.github.dockerjava.core.NameParser.HostnameReposName;
+import com.github.dockerjava.core.NameParser.ReposTag;
+
+/**
+ * Respects some of the docker CLI options. See https://docs.docker.com/engine/reference/commandline/cli/#environment-variables
+ */
+public class DefaultDockerClientConfig implements Serializable, DockerClientConfig {
+
+ private static final long serialVersionUID = -4307357472441531489L;
+
+ public static final String DOCKER_HOST = "DOCKER_HOST";
+
+ public static final String DOCKER_TLS_VERIFY = "DOCKER_TLS_VERIFY";
+
+ public static final String DOCKER_CONFIG = "DOCKER_CONFIG";
+
+ public static final String DOCKER_CERT_PATH = "DOCKER_CERT_PATH";
+
+ public static final String API_VERSION = "api.version";
+
+ public static final String REGISTRY_USERNAME = "registry.username";
+
+ public static final String REGISTRY_PASSWORD = "registry.password";
+
+ public static final String REGISTRY_EMAIL = "registry.email";
+
+ public static final String REGISTRY_URL = "registry.url";
+
+ private static final String DOCKER_JAVA_PROPERTIES = "docker-java.properties";
+
+ private static final String DOCKER_CFG = ".dockercfg";
+
+ private static final Set CONFIG_KEYS = new HashSet();
+
+ static {
+ CONFIG_KEYS.add(DOCKER_HOST);
+ CONFIG_KEYS.add(DOCKER_TLS_VERIFY);
+ CONFIG_KEYS.add(DOCKER_CONFIG);
+ CONFIG_KEYS.add(DOCKER_CERT_PATH);
+ CONFIG_KEYS.add(API_VERSION);
+ CONFIG_KEYS.add(REGISTRY_USERNAME);
+ CONFIG_KEYS.add(REGISTRY_PASSWORD);
+ CONFIG_KEYS.add(REGISTRY_EMAIL);
+ CONFIG_KEYS.add(REGISTRY_URL);
+ }
+
+ private final URI dockerHost;
+
+ private final String registryUsername, registryPassword, registryEmail, registryUrl, dockerConfig;
+
+ private final SSLConfig sslConfig;
+
+ private final RemoteApiVersion apiVersion;
+
+ DefaultDockerClientConfig(URI dockerHost, String dockerConfig, String apiVersion, String registryUrl,
+ String registryUsername, String registryPassword, String registryEmail, SSLConfig sslConfig) {
+ this.dockerHost = checkDockerHostScheme(dockerHost);
+ this.dockerConfig = dockerConfig;
+ this.apiVersion = RemoteApiVersion.parseConfigWithDefault(apiVersion);
+ this.sslConfig = sslConfig;
+ this.registryUsername = registryUsername;
+ this.registryPassword = registryPassword;
+ this.registryEmail = registryEmail;
+ this.registryUrl = registryUrl;
+ }
+
+ private URI checkDockerHostScheme(URI dockerHost) {
+ if ("tcp".equals(dockerHost.getScheme()) || "unix".equals(dockerHost.getScheme())) {
+ return dockerHost;
+ } else {
+ throw new DockerClientException("Unsupported protocol scheme found: '" + dockerHost
+ + "'. Only 'tcp://' or 'unix://' supported.");
+ }
+ }
+
+ private static Properties loadIncludedDockerProperties(Properties systemProperties) {
+ try (InputStream is = DefaultDockerClientConfig.class.getResourceAsStream("/" + DOCKER_JAVA_PROPERTIES)) {
+ Properties p = new Properties();
+ p.load(is);
+ replaceProperties(p, systemProperties);
+ return p;
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private static void replaceProperties(Properties properties, Properties replacements) {
+ for (Object objectKey : properties.keySet()) {
+ String key = objectKey.toString();
+ properties.setProperty(key, replaceProperties(properties.getProperty(key), replacements));
+ }
+ }
+
+ private static String replaceProperties(String s, Properties replacements) {
+ for (Map.Entry