I try to make simple docker-java application on centos 7. Building image and container invocation are successful. This is my codes
public class JavaClient {
public static void main(String[] args) throws Exception { // TODO Auto-generated method stub DockerClientConfig config = DockerClientConfig.createDefaultConfigBuilder() .withRegistryUrl("unix:///var/run/docker.sock") .withDockerCertPath("/root/.docker/certs") .withRegistryUsername("user01") .withRegistryPassword("111111") .withRegistryEmail("user01@naver.com") .build();
DockerClient dockerClient = DockerClientBuilder.getInstance(config).build(); System.out.println(dockerClient.versionCmd());
}
}
However I can’t find the docker security files at all. Docker installation, building images and container invocation have no problem. But I don’t know where ssl files in centos 7 are. This is the exception message
Exception in thread “main” com.github.dockerjava.api.exception.DockerClientException: Certificate path (DOCKER_CERT_PATH) ‘/root/.docker/certs’ doesn’t exist.
at com.github.dockerjava.core.DockerClientConfig.checkDockerCertPath(DockerClientConfig.java:112)
at com.github.dockerjava.core.DockerClientConfig.(DockerClientConfig.java:85)
at com.github.dockerjava.core.DockerClientConfig$DockerClientConfigBuilder.build(DockerClientConfig.java:432)
at com.aaa.docker.JavaClient.main(JavaClient.java:18)
Your advice will be deeply appreciated. Thanks