/** * This will set all fields in the builder to those contained in the Properties object. The Properties object should contain the * following docker-java configuration keys: DOCKER_HOST, DOCKER_TLS_VERIFY, api.version, registry.username, registry.password, * registry.email, DOCKER_CERT_PATH, and DOCKER_CONFIG. */ public Builder withProperties(Properties p) { return withDockerHost(p.getProperty(DOCKER_HOST)) .withDockerTlsVerify(p.getProperty(DOCKER_TLS_VERIFY)) .withDockerConfig(p.getProperty(DOCKER_CONFIG)) .withDockerCertPath(p.getProperty(DOCKER_CERT_PATH)) .withApiVersion(p.getProperty(API_VERSION)) .withRegistryUsername(p.getProperty(REGISTRY_USERNAME)) .withRegistryPassword(p.getProperty(REGISTRY_PASSWORD)) .withRegistryEmail(p.getProperty(REGISTRY_EMAIL)) .withRegistryUrl(p.getProperty(REGISTRY_URL)); }
/** * This will set all fields in the builder to those contained in the Properties object. The Properties object should contain the * following docker-java configuration keys: DOCKER_HOST, DOCKER_TLS_VERIFY, api.version, registry.username, registry.password, * registry.email, DOCKER_CERT_PATH, and DOCKER_CONFIG. */ public Builder withProperties(Properties p) { return withDockerHost(p.getProperty(DOCKER_HOST)) .withDockerTlsVerify(p.getProperty(DOCKER_TLS_VERIFY)) .withDockerConfig(p.getProperty(DOCKER_CONFIG)) .withDockerCertPath(p.getProperty(DOCKER_CERT_PATH)) .withApiVersion(p.getProperty(API_VERSION)) .withRegistryUsername(p.getProperty(REGISTRY_USERNAME)) .withRegistryPassword(p.getProperty(REGISTRY_PASSWORD)) .withRegistryEmail(p.getProperty(REGISTRY_EMAIL)) .withRegistryUrl(p.getProperty(REGISTRY_URL)); }
builder = builder.withDockerConfig(cfgPath); } else if (StringUtils.isNotBlank(currentUsersHomeDir)) { final File legacyCfgFile = new File(currentUsersHomeDir + "/.dockercfg"); builder = builder.withDockerConfig(currentUsersHomeDir + "/.docker"); } else if (legacyCfgFile.exists()) { getLog().info("Using legacy configuration file: " + legacyCfgFile.getAbsolutePath()); builder = builder.withDockerConfig(currentUsersHomeDir);