|
|
@@ -88,6 +88,7 @@ public class DockerImpl implements Docker {
|
|
|
textFile.write(dockerfile, dockerfileContent);
|
|
|
String imageId = dockerClient.buildImageCmd()
|
|
|
.withDockerfile(dockerfile)
|
|
|
+ .withPull(true) // 镜像不存在则拉取
|
|
|
// repoTag 格式为 docker.reghao.cn/devops:12345678
|
|
|
.withTags(Set.of(repoTag))
|
|
|
.start()
|
|
|
@@ -101,6 +102,7 @@ public class DockerImpl implements Docker {
|
|
|
String dockerfilePath = compileHome + "/Dockerfile";
|
|
|
dockerClient.buildImageCmd()
|
|
|
.withDockerfile(new File(dockerfilePath))
|
|
|
+ .withPull(true) // 镜像不存在则拉取
|
|
|
.withTags(Set.of(repoTag))
|
|
|
.start()
|
|
|
.awaitImageId(300, TimeUnit.SECONDS);
|