Browse Source

设置 docker 私有仓库需要的认证

reghao 2 years ago
parent
commit
1c70fb306f

+ 3 - 3
common/src/main/java/cn/reghao/devops/common/docker/DockerImpl.java

@@ -35,9 +35,9 @@ public class DockerImpl implements Docker {
         DockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder()
                 .withDockerHost("unix:///var/run/docker.sock")
                 .withDockerTlsVerify(false)
-                //.withDockerCertPath("/home/user/.docker")
-                //.withRegistryUsername(registryUser)
-                //.withRegistryPassword(registryPass)
+                .withDockerCertPath(String.format("%s/.docker", System.getProperty("user.home")))
+                //.withRegistryUsername("username")
+                //.withRegistryPassword("password")
                 //.withRegistryEmail(registryMail)
                 //.withRegistryUrl(registryUrl)
                 .build();