1
0

fix: use image load

This commit is contained in:
2024-02-21 18:57:10 +00:00
parent 8251927821
commit c17676d0f9
2 changed files with 19 additions and 1 deletions

View File

@ -77,6 +77,24 @@ func Images() (diis []Image, err error) {
return
}
func Load(path string) (err error) {
exist := Container{name: name}.Exist()
if exist && UseCache {
return
}
cmd := exec.Command(Runtime, "load", "-i", path)
log.Debug().Msgf("%v", cmd)
raw, err := cmd.CombinedOutput()
if err != nil {
log.Debug().Err(err).Msg(string(raw))
return
}
return
}
func Import(path, name string) (err error) {
exist := Container{name: name}.Exist()
if exist && UseCache {