public static DockerClient buildDockerClient(Map<String, String> providerProperties) { Properties properties = new Properties(); properties.put(DefaultDockerClientConfig.API_VERSION, "1.22"); properties.putAll(providerProperties); DockerClientConfig config = new DefaultDockerClientConfig.Builder().withProperties(properties).build(); NettyDockerCmdExecFactory execFactory = new NettyDockerCmdExecFactory(); return DockerClientBuilder.getInstance(config).withDockerCmdExecFactory(execFactory).build(); }
/** * Allows you to build the config without system environment interfering for more robust testing */ static Builder createDefaultConfigBuilder(Map<String, String> env, Properties systemProperties) { Properties properties = loadIncludedDockerProperties(systemProperties); properties = overrideDockerPropertiesWithSettingsFromUserHome(properties, systemProperties); properties = overrideDockerPropertiesWithEnv(properties, env); properties = overrideDockerPropertiesWithSystemProperties(properties, systemProperties); return new Builder().withProperties(properties); }
/** * Allows you to build the config without system environment interfering for more robust testing */ static Builder createDefaultConfigBuilder(Map<String, String> env, Properties systemProperties) { Properties properties = loadIncludedDockerProperties(systemProperties); properties = overrideDockerPropertiesWithSettingsFromUserHome(properties, systemProperties); properties = overrideDockerPropertiesWithEnv(properties, env); properties = overrideDockerPropertiesWithSystemProperties(properties, systemProperties); return new Builder().withProperties(properties); }