diff --git a/build/build.go b/build/build.go index 567f73d1..c83762c0 100644 --- a/build/build.go +++ b/build/build.go @@ -382,6 +382,15 @@ func toSolveOpt(d driver.Driver, multiDriver bool, opt Options, dl dockerLoadCal } } + // cacheonly is a fake exporter to opt out of default behaviors + exports := make([]client.ExportEntry, 0, len(opt.Exports)) + for _, e := range opt.Exports { + if e.Type != "cacheonly" { + exports = append(exports, e) + } + } + opt.Exports = exports + // set up exporters for i, e := range opt.Exports { if (e.Type == "local" || e.Type == "tar") && opt.ImageIDFile != "" {