1
0

Check for local docker image

This commit is contained in:
dump_stack() 2023-01-30 11:15:12 +00:00
parent b8bb11943a
commit 0e185ab36b
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

View File

@ -128,7 +128,13 @@ func generateBaseDockerImage(registry string, commands []config.DockerCommand,
d := "# BASE\n"
if exists(dockerPath) {
cmd := exec.Command("docker", "images", "-q", sk.DockerName())
rawOutput, err := cmd.CombinedOutput()
if err != nil {
return
}
if exists(dockerPath) && string(rawOutput) != "" {
log.Printf("Base image for %s:%s found",
sk.DistroType.String(), sk.DistroRelease)
return
@ -231,8 +237,8 @@ func generateBaseDockerImage(registry string, commands []config.DockerCommand,
return
}
cmd := exec.Command("docker", "build", "-t", sk.DockerName(), imagePath)
rawOutput, err := cmd.CombinedOutput()
cmd = exec.Command("docker", "build", "-t", sk.DockerName(), imagePath)
rawOutput, err = cmd.CombinedOutput()
if err != nil {
log.Printf("Base image for %s:%s generating error, see log",
sk.DistroType.String(), sk.DistroRelease)