Skip to content

Commit

Permalink
build: fix wrong default Dockerfile path when running in docker
Browse files Browse the repository at this point in the history
Signed-off-by: Adphi <[email protected]>
  • Loading branch information
Adphi committed Sep 10, 2022
1 parent 9893c8a commit 35e6aae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/d2vm/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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
Expand All @@ -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"
}
Expand Down

0 comments on commit 35e6aae

Please sign in to comment.