Reputation: 452
I want to pull image on remote docker-machine so I found one git repo which will run docker using java.
So I tried using the following way,
final DockerClient docker = DefaultDockerClient.builder()
.uri(URI.create("https://remote ipaddress:port"))
.dockerCertificates(new DockerCertificates(docker certificate path))
.build();
final HostConfig hostConfig = HostConfig.builder().build();
docker.pull("image name");
final ContainerConfig containerConfig = ContainerConfig.builder()
.hostConfig(hostConfig)
.image("image name")
.cmd("sh", "-c", "while :; do sleep 1; done")
.build();
final ContainerCreation creation = docker.createContainer(containerConfig);
final String id = creation.id();
docker.startContainer(id);
After following all the step I am not able to pull image on remote docker configuration pc.
So as a conclusion I want to run docker from the current machine to provided remote docker configuration using java. If you have any idea how can I achieve please let me know.
Upvotes: 1
Views: 718