From 3862ff269bf333ef2fce0b0aece040e308b842ec Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Mon, 27 Jul 2020 22:38:06 -0700 Subject: [PATCH] build: add opt-out from default load behavior Signed-off-by: Tonis Tiigi --- build/build.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/build.go b/build/build.go index c83762c0..532bb0c1 100644 --- a/build/build.go +++ b/build/build.go @@ -343,11 +343,13 @@ func toSolveOpt(d driver.Driver, multiDriver bool, opt Options, dl dockerLoadCal IsDefaultMobyDriver() }) + noDefaultLoad, _ := strconv.ParseBool(os.Getenv("BUILDX_NO_DEFAULT_LOAD")) + switch len(opt.Exports) { case 1: // valid case 0: - if isDefaultMobyDriver { + if isDefaultMobyDriver && !noDefaultLoad { // backwards compat for docker driver only: // this ensures the build results in a docker image. opt.Exports = []client.ExportEntry{{Type: "image", Attrs: map[string]string{}}}