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" 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", log.Printf("Base image for %s:%s found",
sk.DistroType.String(), sk.DistroRelease) sk.DistroType.String(), sk.DistroRelease)
return return
@ -231,8 +237,8 @@ func generateBaseDockerImage(registry string, commands []config.DockerCommand,
return return
} }
cmd := exec.Command("docker", "build", "-t", sk.DockerName(), imagePath) cmd = exec.Command("docker", "build", "-t", sk.DockerName(), imagePath)
rawOutput, err := cmd.CombinedOutput() rawOutput, err = cmd.CombinedOutput()
if err != nil { if err != nil {
log.Printf("Base image for %s:%s generating error, see log", log.Printf("Base image for %s:%s generating error, see log",
sk.DistroType.String(), sk.DistroRelease) sk.DistroType.String(), sk.DistroRelease)