Force another solve, so that the LLB created by the
dockerfile.v0 frontend actually runs, as we expect it to. Also, enforce Evaluate: true on SolveRequests that run through the Solver Signed-off-by: Joel Longtine <joel@dagger.io>
This commit is contained in:
parent
1c06504bde
commit
6e28c0505f
@ -115,6 +115,18 @@ func (t *buildTask) dockerfile(ctx context.Context, pctx *plancontext.Context, s
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
st, err := ref.ToState()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
solvedRef, err := s.Solve(ctx, st, pctx.Platform.Get())
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
// Image metadata
|
// Image metadata
|
||||||
meta, ok := res.Metadata[exptypes.ExporterImageConfigKey]
|
meta, ok := res.Metadata[exptypes.ExporterImageConfigKey]
|
||||||
if !ok {
|
if !ok {
|
||||||
@ -126,7 +138,7 @@ func (t *buildTask) dockerfile(ctx context.Context, pctx *plancontext.Context, s
|
|||||||
}
|
}
|
||||||
|
|
||||||
return compiler.NewValue().FillFields(map[string]interface{}{
|
return compiler.NewValue().FillFields(map[string]interface{}{
|
||||||
"output": pctx.FS.New(ref).MarshalCUE(),
|
"output": pctx.FS.New(solvedRef).MarshalCUE(),
|
||||||
"config": image.Config,
|
"config": image.Config,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -120,6 +120,7 @@ func (s Solver) ResolveImageConfig(ctx context.Context, ref string, opts llb.Res
|
|||||||
|
|
||||||
// Solve will block until the state is solved and returns a Reference.
|
// Solve will block until the state is solved and returns a Reference.
|
||||||
func (s Solver) SolveRequest(ctx context.Context, req bkgw.SolveRequest) (*bkgw.Result, error) {
|
func (s Solver) SolveRequest(ctx context.Context, req bkgw.SolveRequest) (*bkgw.Result, error) {
|
||||||
|
req.Evaluate = true
|
||||||
res, err := s.opts.Gateway.Solve(ctx, req)
|
res, err := s.opts.Gateway.Solve(ctx, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, CleanError(err)
|
return nil, CleanError(err)
|
||||||
|
Reference in New Issue
Block a user