use of com.github.dockerjava.core.DefaultDockerClientConfig in project tutorials by eugenp.
the class DockerClientLiveTest method whenCreatingDockerClientWithProperties_thenReturnInstance.
@Test
public void whenCreatingDockerClientWithProperties_thenReturnInstance() {
// when
Properties properties = new Properties();
properties.setProperty("registry.email", "info@bealdung.com");
properties.setProperty("registry.url", "register.bealdung.io/v2/");
properties.setProperty("registry.password", "strongpassword");
properties.setProperty("registry.username", "bealdung");
properties.setProperty("DOCKER_CERT_PATH", "/home/bealdung/public/.docker/certs");
properties.setProperty("DOCKER_CONFIG", "/home/bealdung/public/.docker/");
properties.setProperty("DOCKER_TLS_VERIFY", "1");
properties.setProperty("DOCKER_HOST", "tcp://docker.bealdung.com:2376");
DefaultDockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder().withProperties(properties).build();
DockerClient dockerClient = DockerClientBuilder.getInstance(config).build();
// then
assertNotNull(dockerClient);
}
use of com.github.dockerjava.core.DefaultDockerClientConfig in project tutorials by eugenp.
the class DockerClientLiveTest method whenCreatingAdvanceDockerClient_thenReturnInstance.
@Test
public void whenCreatingAdvanceDockerClient_thenReturnInstance() {
// when
DefaultDockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder().withRegistryEmail("info@bealdung.com").withRegistryUrl("register.bealdung.io/v2/").withRegistryPassword("strongpassword").withRegistryUsername("bealdung").withDockerCertPath("/home/bealdung/public/.docker/certs").withDockerConfig("/home/bealdung/public/.docker/").withDockerTlsVerify("1").withDockerHost("tcp://docker.beauldung.com:2376").build();
DockerClient dockerClient = DockerClientBuilder.getInstance(config).build();
// then
assertNotNull(dockerClient);
}
Aggregations