|
|
@ -375,6 +375,7 @@ type Target struct {
|
|
|
|
|
|
|
|
|
|
|
|
Context *string `json:"context,omitempty" hcl:"context,optional"`
|
|
|
|
Context *string `json:"context,omitempty" hcl:"context,optional"`
|
|
|
|
Dockerfile *string `json:"dockerfile,omitempty" hcl:"dockerfile,optional"`
|
|
|
|
Dockerfile *string `json:"dockerfile,omitempty" hcl:"dockerfile,optional"`
|
|
|
|
|
|
|
|
DockerfileInline *string `json:"dockerfile-inline,omitempty" hcl:"dockerfile-inline,optional"`
|
|
|
|
Args map[string]string `json:"args,omitempty" hcl:"args,optional"`
|
|
|
|
Args map[string]string `json:"args,omitempty" hcl:"args,optional"`
|
|
|
|
Labels map[string]string `json:"labels,omitempty" hcl:"labels,optional"`
|
|
|
|
Labels map[string]string `json:"labels,omitempty" hcl:"labels,optional"`
|
|
|
|
Tags []string `json:"tags,omitempty" hcl:"tags,optional"`
|
|
|
|
Tags []string `json:"tags,omitempty" hcl:"tags,optional"`
|
|
|
@ -460,6 +461,9 @@ func toBuildOpt(t *Target, inp *Input) (*build.Options, error) {
|
|
|
|
ContextPath: contextPath,
|
|
|
|
ContextPath: contextPath,
|
|
|
|
DockerfilePath: dockerfilePath,
|
|
|
|
DockerfilePath: dockerfilePath,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if t.DockerfileInline != nil {
|
|
|
|
|
|
|
|
bi.DockerfileInline = *t.DockerfileInline
|
|
|
|
|
|
|
|
}
|
|
|
|
updateContext(&bi, inp)
|
|
|
|
updateContext(&bi, inp)
|
|
|
|
|
|
|
|
|
|
|
|
bo := &build.Options{
|
|
|
|
bo := &build.Options{
|
|
|
@ -527,6 +531,9 @@ func merge(t1, t2 *Target) *Target {
|
|
|
|
if t2.Dockerfile != nil {
|
|
|
|
if t2.Dockerfile != nil {
|
|
|
|
t1.Dockerfile = t2.Dockerfile
|
|
|
|
t1.Dockerfile = t2.Dockerfile
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if t2.DockerfileInline != nil {
|
|
|
|
|
|
|
|
t1.DockerfileInline = t2.DockerfileInline
|
|
|
|
|
|
|
|
}
|
|
|
|
for k, v := range t2.Args {
|
|
|
|
for k, v := range t2.Args {
|
|
|
|
if t1.Args == nil {
|
|
|
|
if t1.Args == nil {
|
|
|
|
t1.Args = map[string]string{}
|
|
|
|
t1.Args = map[string]string{}
|
|
|
|