Skip to content

Commit 7bd09be

Browse files
committed
dockerfile: make sure stage is reachable before validating base
If base was not reachable then the config was not loaded in and the platform to compare with is not correct. Signed-off-by: Tonis Tiigi <[email protected]>
1 parent 03d2f9f commit 7bd09be

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

frontend/dockerfile/dockerfile2llb/convert.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,9 @@ func toDispatchState(ctx context.Context, dt []byte, opt ConvertOpt) (*dispatchS
601601
llb.WithCustomName(prefixCommand(d, "FROM "+d.stage.BaseName, opt.MultiPlatformRequested, platform, nil)),
602602
location(opt.SourceMap, d.stage.Location),
603603
)
604-
validateBaseImagePlatform(origName, *platform, d.image.Platform, d.stage.Location, lint)
604+
if reachable {
605+
validateBaseImagePlatform(origName, *platform, d.image.Platform, d.stage.Location, lint)
606+
}
605607
}
606608
d.platform = platform
607609
return nil

0 commit comments

Comments
 (0)