From c3a6d80716406d4534b3269519a6ec06910ee511 Mon Sep 17 00:00:00 2001 From: Tom Chauveau Date: Mon, 21 Mar 2022 22:30:46 +0100 Subject: [PATCH] Complete exportImageConfig to bind platform metadata. Resolves #1802 Signed-off-by: Vasek - Tom C --- plan/task/push.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plan/task/push.go b/plan/task/push.go index 5e34fcfc..4a7c4d04 100644 --- a/plan/task/push.go +++ b/plan/task/push.go @@ -67,9 +67,15 @@ func (c *pushTask) Run(ctx context.Context, pctx *plancontext.Context, s solver. 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 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, Attrs: map[string]string{ "name": dest.String(),