Skip to content

Commit

Permalink
build: add opt-out from default load behavior
Browse files Browse the repository at this point in the history
Signed-off-by: Tonis Tiigi <[email protected]>
  • Loading branch information
tonistiigi committed Jul 28, 2020
1 parent 9e5321e commit 3862ff2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}}}
Expand Down

0 comments on commit 3862ff2

Please sign in to comment.