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:
parent
9893c8a95a
commit
35e6aae345
@ -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"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user