2
0
mirror of https://github.com/linka-cloud/d2vm.git synced 2024-11-22 07:46:25 +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 (
file = "Dockerfile"
tag = "d2vm-"+uuid.New().String()
tag = "d2vm-" + uuid.New().String()
networkManager string
buildArgs []string
buildCmd = &cobra.Command{
@ -45,6 +45,9 @@ var (
if err != nil {
return err
}
if file == "" {
file = filepath.Join(args[0], "Dockerfile")
}
dockerFileAbsPath, err := filepath.Abs(file)
if err != nil {
return err
@ -70,7 +73,7 @@ var (
}
dargs[i] = filepath.Join("/in", rel)
case output:
dargs[i] = filepath.Join("/out", output)
dargs[i] = filepath.Join("/out", filepath.Base(output))
case args[0]:
dargs[i] = "/in"
}