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

convert / build: add networking support through network-manager flag

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
2022-08-08 17:58:49 +02:00
parent adbd4c7233
commit b09f0e07ad
8 changed files with 91 additions and 21 deletions

View File

@@ -28,7 +28,7 @@ import (
"go.linka.cloud/d2vm/pkg/docker"
)
func Convert(ctx context.Context, img string, size int64, password string, output string, cmdLineExtra string) error {
func Convert(ctx context.Context, img string, size int64, password string, output string, cmdLineExtra string, networkManager NetworkManager) error {
imgUUID := uuid.New().String()
tmpPath := filepath.Join(os.TempDir(), "d2vm", imgUUID)
if err := os.MkdirAll(tmpPath, os.ModePerm); err != nil {
@@ -41,7 +41,7 @@ func Convert(ctx context.Context, img string, size int64, password string, outpu
if err != nil {
return err
}
d, err := NewDockerfile(r, img, password)
d, err := NewDockerfile(r, img, password, networkManager)
if err != nil {
return err
}