Complete exportImageConfig to bind platform metadata.

Resolves #1802

Signed-off-by: Vasek - Tom C <tom.chauveau@epitech.eu>
This commit is contained in:
Tom Chauveau 2022-03-21 22:30:46 +01:00 committed by Vasek - Tom C
parent fead547df1
commit c3a6d80716
No known key found for this signature in database
GPG Key ID: 175D82E572427960

View File

@ -67,9 +67,15 @@ func (c *pushTask) Run(ctx context.Context, pctx *plancontext.Context, s solver.
return nil, err return nil, err
} }
// Add platform to image configuration
exportImageConfig := &dockerfile2llb.Image{Config: imageConfig.ToSpec()}
exportImageConfig.OS = pctx.Platform.Get().OS
exportImageConfig.Architecture = pctx.Platform.Get().Architecture
exportImageConfig.Variant = pctx.Platform.Get().Variant
// Export image // Export image
lg.Debug().Str("dest", dest.String()).Msg("export image") lg.Debug().Str("dest", dest.String()).Msg("export image")
resp, err := s.Export(ctx, st, &dockerfile2llb.Image{Config: imageConfig.ToSpec()}, bk.ExportEntry{ resp, err := s.Export(ctx, st, exportImageConfig, bk.ExportEntry{
Type: bk.ExporterImage, Type: bk.ExporterImage,
Attrs: map[string]string{ Attrs: map[string]string{
"name": dest.String(), "name": dest.String(),