fix: use image load
This commit is contained in:
parent
8251927821
commit
c17676d0f9
@ -175,7 +175,7 @@ func (cmd *KernelCmd) fetchContainerCache(c container.Container) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
path := cache.ContainerURL(c.Name())
|
path := cache.ContainerURL(c.Name())
|
||||||
err := container.Import(path, c.Name())
|
err := container.Load(path, c.Name())
|
||||||
if err == nil {
|
if err == nil {
|
||||||
log.Info().Msgf("container %s -> %s", path, c.Name())
|
log.Info().Msgf("container %s -> %s", path, c.Name())
|
||||||
}
|
}
|
||||||
|
@ -77,6 +77,24 @@ func Images() (diis []Image, err error) {
|
|||||||
return
|
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) {
|
func Import(path, name string) (err error) {
|
||||||
exist := Container{name: name}.Exist()
|
exist := Container{name: name}.Exist()
|
||||||
if exist && UseCache {
|
if exist && UseCache {
|
||||||
|
Loading…
Reference in New Issue
Block a user