Skip to content

Commit 177b980

Browse files
authored
Merge pull request #3385 from marxarelli/feature/support-buildkit-syntax-arg
Add BUILDKIT_SYNTAX option handling
2 parents 15da604 + fc3ecb6 commit 177b980

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

build/opt.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ func toSolveOpt(ctx context.Context, node builder.Node, multiDriver bool, opt *O
116116
so.FrontendAttrs["cgroup-parent"] = opt.CgroupParent
117117
}
118118

119+
if v, ok := opt.BuildArgs["BUILDKIT_SYNTAX"]; ok {
120+
p := strings.SplitN(strings.TrimSpace(v), " ", 2)
121+
so.Frontend = "gateway.v0"
122+
so.FrontendAttrs["source"] = p[0]
123+
so.FrontendAttrs["cmdline"] = v
124+
}
125+
119126
if v, ok := opt.BuildArgs["BUILDKIT_MULTI_PLATFORM"]; ok {
120127
if v, _ := strconv.ParseBool(v); v {
121128
so.FrontendAttrs["multi-platform"] = "true"

0 commit comments

Comments
 (0)