1
0

fix: untag duplicate image in case of docker

This commit is contained in:
dump_stack() 2024-10-06 15:33:35 +00:00
parent cdfa480479
commit c3c97c3828
Signed by: dump_stack
GPG Key ID: C9905BA72B5E02BB

View File

@ -97,13 +97,23 @@ func Load(localpath string, name string) (err error) {
return
}
if strings.Contains(Runtime, "docker") {
var err2 error
cmd = exec.Command(Runtime, "tag", "localhost/"+name, name)
log.Debug().Msgf("%v", cmd)
raw, err = cmd.CombinedOutput()
if err != nil {
log.Debug().Err(err).Msg(string(raw))
return
raw, err2 = cmd.CombinedOutput()
if err2 != nil {
log.Debug().Err(err2).Msg(string(raw))
}
cmd = exec.Command(Runtime, "rmi", "localhost/"+name)
log.Debug().Msgf("%v", cmd)
raw, err2 = cmd.CombinedOutput()
if err2 != nil {
log.Debug().Err(err2).Msg(string(raw))
}
}
return