Search in sources :

Example 6 with DockerHost

use of org.springframework.boot.buildpack.platform.docker.configuration.DockerHost in project spring-boot by spring-projects.

the class DockerTests method asDockerConfigurationWithHostConfiguration.

@Test
void asDockerConfigurationWithHostConfiguration() {
    Docker docker = new Docker();
    docker.setHost("docker.example.com");
    docker.setTlsVerify(true);
    docker.setCertPath("/tmp/ca-cert");
    DockerConfiguration dockerConfiguration = docker.asDockerConfiguration();
    DockerHost host = dockerConfiguration.getHost();
    assertThat(host.getAddress()).isEqualTo("docker.example.com");
    assertThat(host.isSecure()).isEqualTo(true);
    assertThat(host.getCertificatePath()).isEqualTo("/tmp/ca-cert");
    assertThat(docker.asDockerConfiguration().getBuilderRegistryAuthentication()).isNull();
    assertThat(docker.asDockerConfiguration().getPublishRegistryAuthentication()).isNull();
}
Also used : DockerConfiguration(org.springframework.boot.buildpack.platform.docker.configuration.DockerConfiguration) DockerHost(org.springframework.boot.buildpack.platform.docker.configuration.DockerHost) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)6 DockerHost (org.springframework.boot.buildpack.platform.docker.configuration.DockerHost)6 DockerConfiguration (org.springframework.boot.buildpack.platform.docker.configuration.DockerConfiguration)3