Signed-off-by: Wang Yumu <37442693@qq.com>
| ... | ... |
@@ -151,7 +151,7 @@ func (is *Source) ResolveImageConfig(ctx context.Context, ref string, opt llb.Re |
| 151 | 151 |
case source.ResolveModePreferLocal: |
| 152 | 152 |
img, err := is.resolveLocal(ref) |
| 153 | 153 |
if err == nil {
|
| 154 |
- if !platformMatches(img, opt.Platform) {
|
|
| 154 |
+ if opt.Platform != nil && !platformMatches(img, opt.Platform) {
|
|
| 155 | 155 |
logrus.WithField("ref", ref).Debugf("Requested build platform %s does not match local image platform %s, checking remote",
|
| 156 | 156 |
path.Join(opt.Platform.OS, opt.Platform.Architecture, opt.Platform.Variant), |
| 157 | 157 |
path.Join(img.OS, img.Architecture, img.Variant), |