2
0
mirror of https://github.com/linka-cloud/d2vm.git synced 2024-11-29 11:06:24 +00:00

build: fix wrong default Dockerfile path when running in docker

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
Adphi 2022-09-09 14:26:08 +02:00
parent 9893c8a95a
commit 35e6aae345
Signed by: adphi
GPG Key ID: 46BE4062DB2397FF

View File

@ -31,7 +31,7 @@ import (
var ( var (
file = "Dockerfile" file = "Dockerfile"
tag = "d2vm-"+uuid.New().String() tag = "d2vm-" + uuid.New().String()
networkManager string networkManager string
buildArgs []string buildArgs []string
buildCmd = &cobra.Command{ buildCmd = &cobra.Command{
@ -45,6 +45,9 @@ var (
if err != nil { if err != nil {
return err return err
} }
if file == "" {
file = filepath.Join(args[0], "Dockerfile")
}
dockerFileAbsPath, err := filepath.Abs(file) dockerFileAbsPath, err := filepath.Abs(file)
if err != nil { if err != nil {
return err return err
@ -70,7 +73,7 @@ var (
} }
dargs[i] = filepath.Join("/in", rel) dargs[i] = filepath.Join("/in", rel)
case output: case output:
dargs[i] = filepath.Join("/out", output) dargs[i] = filepath.Join("/out", filepath.Base(output))
case args[0]: case args[0]:
dargs[i] = "/in" dargs[i] = "/in"
} }