build: avoid default load with --print

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit fbb0f9b424a761ceaf9f17936aa2183701d41b32)
This commit is contained in:
Tonis Tiigi 2024-04-18 18:12:39 -07:00 committed by Jonathan A. Sternberg
parent 171fcbeb69
commit b77648d5f8
No known key found for this signature in database
GPG Key ID: 6603D4B96394F6B1

View File

@ -162,7 +162,7 @@ func toSolveOpt(ctx context.Context, node builder.Node, multiDriver bool, opt Op
case 1:
// valid
case 0:
if !noDefaultLoad() {
if !noDefaultLoad() && opt.PrintFunc == nil {
if nodeDriver.IsMobyDriver() {
// backwards compat for docker driver only:
// this ensures the build results in a docker image.