@@ -189,6 +189,10 @@ func buildImageComponents(ctx context.Context, workDir string, archs []types.Arc
189
189
return nil , nil , err
190
190
}
191
191
192
+ if ic .Contents .BaseImage != nil && o .Lockfile == "" {
193
+ return nil , nil , fmt .Errorf ("building with base image is supported only with a lockfile" )
194
+ }
195
+
192
196
// cases:
193
197
// - archs set: use those archs
194
198
// - archs not set, bc.ImageConfiguration.Archs set: use Config archs
@@ -202,7 +206,6 @@ func buildImageComponents(ctx context.Context, workDir string, archs []types.Arc
202
206
ic .Archs = types .AllArchs
203
207
}
204
208
// save the final set we will build
205
- archs = ic .Archs
206
209
log .Infof ("Building images for %d architectures: %+v" , len (ic .Archs ), ic .Archs )
207
210
208
211
// Probe the VCS URL if it is not set and we are asked to do so.
@@ -239,15 +242,8 @@ func buildImageComponents(ctx context.Context, workDir string, archs []types.Arc
239
242
multiArchBDE := o .SourceDateEpoch
240
243
241
244
configs , _ , err := build .LockImageConfiguration (ctx , * ic , opts ... )
242
- mc , err := build .NewMultiArch (ctx , archs , opts ... )
243
245
if err != nil {
244
- return nil , nil , err
245
- }
246
-
247
- for _ , bc := range mc .Contexts {
248
- if bc .ImageConfiguration ().Contents .BaseImage != nil && o .Lockfile == "" {
249
- return nil , nil , fmt .Errorf ("building with base image is supported only with a lockfile" )
250
- }
246
+ return nil , nil , fmt .Errorf ("locking config: %w" , err )
251
247
}
252
248
253
249
for arch , ic := range configs {
0 commit comments