2
0
mirror of https://github.com/linka-cloud/d2vm.git synced 2025-12-14 15:03:12 +00:00

refactoring: explicit docker commands

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
2022-04-24 16:27:04 +02:00
parent 20ba409039
commit 085e57a07a
6 changed files with 54 additions and 22 deletions

View File

@@ -56,10 +56,10 @@ func Convert(ctx context.Context, img string, size int64, password string, outpu
return err
}
logrus.Infof("building kernel enabled image")
if err := docker.Cmd(ctx, "image", "build", "-t", imgUUID, "-f", p, dir); err != nil {
if err := docker.Build(ctx, imgUUID, p, dir); err != nil {
return err
}
defer docker.Cmd(ctx, "image", "rm", imgUUID)
defer docker.Remove(ctx, imgUUID)
logrus.Infof("creating vm image")
b, err := NewBuilder(ctx, tmpPath, imgUUID, "", size, r, format)