diff --git a/environment/pipeline.go b/environment/pipeline.go index 85556c4b..df6dc677 100644 --- a/environment/pipeline.go +++ b/environment/pipeline.go @@ -854,7 +854,7 @@ func (p *Pipeline) PushContainer(ctx context.Context, op *compiler.Value, st llb "name": ref.String(), "push": "true", }, - }) + }, p.platform) if err != nil { return st, err @@ -913,7 +913,7 @@ func (p *Pipeline) SaveImage(ctx context.Context, op *compiler.Value, st llb.Sta Output: func(_ map[string]string) (io.WriteCloser, error) { return pipeW, nil }, - }) + }, p.platform) if err != nil { return st, err diff --git a/solver/solver.go b/solver/solver.go index a3f6d7b3..4362c41a 100644 --- a/solver/solver.go +++ b/solver/solver.go @@ -177,7 +177,7 @@ func (s Solver) forwardEvents(ch chan *bk.SolveStatus) { // FIXME: this is currently impleneted as a hack, starting a new Build session // within buildkit from the Control API. Ideally the Gateway API should allow to // Export directly. -func (s Solver) Export(ctx context.Context, st llb.State, img *dockerfile2llb.Image, output bk.ExportEntry) (*bk.SolveResponse, error) { +func (s Solver) Export(ctx context.Context, st llb.State, img *dockerfile2llb.Image, output bk.ExportEntry, platform specs.Platform) (*bk.SolveResponse, error) { // Check close event channel and return if we're already done with the main pipeline select { case <-s.closeCh: @@ -185,7 +185,7 @@ func (s Solver) Export(ctx context.Context, st llb.State, img *dockerfile2llb.Im default: } - def, err := s.Marshal(ctx, st) + def, err := s.Marshal(ctx, st, llb.Platform(platform)) if err != nil { return nil, err }