Define a build context for backends

This commit is contained in:
Ettore Di Giacinto
2021-01-18 11:05:46 +01:00
parent 429e9757db
commit 43b0b11028
3 changed files with 12 additions and 2 deletions

View File

@@ -46,8 +46,12 @@ func (*SimpleDocker) BuildImage(opts compiler.CompilerBackendOptions) error {
name := opts.ImageName
path := opts.SourcePath
dockerfileName := opts.DockerFileName
context := opts.Context
buildarg := []string{"build", "-f", dockerfileName, "-t", name, "."}
if context == "" {
context = "."
}
buildarg := []string{"build", "-f", dockerfileName, "-t", name, context}
Debug(":whale2: Building image " + name)
cmd := exec.Command("docker", buildarg...)