diff --git a/build/build.go b/build/build.go index 13fd0e33f9d1..af27aa32f801 100644 --- a/build/build.go +++ b/build/build.go @@ -331,6 +331,14 @@ func toSolveOpt(d driver.Driver, multiDriver bool, opt Options, dl dockerLoadCal AllowedEntitlements: opt.Allow, } + if !multiDriver { + if v, ok := opt.BuildArgs["BUILDKIT_MULTI_PLATFORM"]; ok { + if v, _ := strconv.ParseBool(v); v { + multiDriver = true + } + } + } + if multiDriver { // force creation of manifest list so.FrontendAttrs["multi-platform"] = "true"