Docker环境可评估

时间:2018-08-07 14:56:28

标签: docker

我正在实现Docker客户端API,但我陷入了中间。任何人都可以帮助我设置环境变量,即使用DockerCertPath设置RegistryUser,registryPass,registryMail,registryUrl。

public class Example1 {
    public static void main(String[] args) {
        // DockerClient dockerClient = DockerClientBuilder.getInstance("tcp://192.168.0.199:2375").build();

        DockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder()
            .withDockerHost("tcp://192.168.0.199:2375")
            .withDockerTlsVerify(true)
            .withDockerCertPath("/home/user/.docker")
            .withRegistryUsername(registryUser)
            .withRegistryPassword(registryPass)
            .withRegistryEmail(registryMail)
            .withRegistryUrl(registryUrl)
            .build();
        Info info =  dockerClient.infoCmd().exec();
        System.out.println("info ===="+info.toString());
    }
}

谢谢

0 个答案:

没有答案