Add target opt to DockerBuild

Signed-off-by: dubo-dubon-duponey <dubodubonduponey+github@pm.me>
This commit is contained in:
dubo-dubon-duponey 2021-05-09 21:09:13 -07:00
parent 6c806a7226
commit 38200f556c
No known key found for this signature in database
GPG Key ID: C3B96779C681DA56
2 changed files with 8 additions and 0 deletions

View File

@ -842,6 +842,13 @@ func dockerBuildOpts(op *compiler.Value) (map[string]string, error) {
opts["filename"] = filename
}
if target := op.Lookup("target"); target.Exists() {
tgr, err := target.String()
if err != nil {
return nil, err
}
opts["target"] = tgr
}
if buildArgs := op.Lookup("buildArg"); buildArgs.Exists() {
fields, err := buildArgs.Fields()
if err != nil {

View File

@ -92,6 +92,7 @@ package op
platforms?: [...string]
buildArg?: [string]: string
label?: [string]: string
target?: string
}
#WriteFile: {