Fix export architecture configuration to resolves #1087

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
Tom Chauveau 2021-11-02 11:39:51 +01:00
parent 954192118e
commit 59f67f9cb5
No known key found for this signature in database
GPG Key ID: 3C9847D981AAC1BF
2 changed files with 4 additions and 4 deletions

View File

@ -854,7 +854,7 @@ func (p *Pipeline) PushContainer(ctx context.Context, op *compiler.Value, st llb
"name": ref.String(), "name": ref.String(),
"push": "true", "push": "true",
}, },
}) }, p.platform)
if err != nil { if err != nil {
return st, err 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) { Output: func(_ map[string]string) (io.WriteCloser, error) {
return pipeW, nil return pipeW, nil
}, },
}) }, p.platform)
if err != nil { if err != nil {
return st, err return st, err

View File

@ -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 // 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 // within buildkit from the Control API. Ideally the Gateway API should allow to
// Export directly. // 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 // Check close event channel and return if we're already done with the main pipeline
select { select {
case <-s.closeCh: case <-s.closeCh:
@ -185,7 +185,7 @@ func (s Solver) Export(ctx context.Context, st llb.State, img *dockerfile2llb.Im
default: default:
} }
def, err := s.Marshal(ctx, st) def, err := s.Marshal(ctx, st, llb.Platform(platform))
if err != nil { if err != nil {
return nil, err return nil, err
} }