Explorar el Código

docker build 时需要处理的问题

reghao hace 4 años
padre
commit
aff56f8161

+ 1 - 0
common/src/main/java/cn/reghao/autodop/common/docker/DockerImpl.java

@@ -61,6 +61,7 @@ public class DockerImpl implements Docker {
         String[] arr = repoTag.split(":");
         try {
             textFile.write(dockerfile, dockerfileContent);
+            // TODO 需要判断构建成功与否,FROM 中的镜像不存在时并不会抛出异常
             dockerClient.buildImageCmd()
                     .withDockerfile(dockerfile)
                     // 格式为 docker.reghao.cn/autodop/dmaster:12345678

+ 0 - 1
dmaster/src/main/java/cn/reghao/autodop/dmaster/app/util/buildtool/packer/DockerPack.java

@@ -30,7 +30,6 @@ public class DockerPack implements CodePacker {
     public String pack(String appId, String commitId, String appRootPath) throws Exception {
         String repo = targetPath + File.separator + appId;
         String image = repo + ":" + commitId;
-        log.info("构建镜像 {}:{}", image, appRootPath);
         docker.build(image, appRootPath, dockerfile);
         return image;
     }