Check for local docker image
This commit is contained in:
parent
b8bb11943a
commit
0e185ab36b
12
kernel.go
12
kernel.go
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user