1
0

feat: implement container import

This commit is contained in:
2023-06-17 08:45:17 +00:00
parent a6944050cc
commit b1f11af512
2 changed files with 23 additions and 0 deletions

View File

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