@@ -29,20 +29,6 @@ type dockerfileTask struct {
|
||||
}
|
||||
|
||||
func (t *dockerfileTask) Run(ctx context.Context, pctx *plancontext.Context, s solver.Solver, v *compiler.Value) (*compiler.Value, error) {
|
||||
frontend, err := v.Lookup("frontend").String()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
switch frontend {
|
||||
case "dockerfile":
|
||||
return t.dockerfile(ctx, pctx, s, v)
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported frontend %q", frontend)
|
||||
}
|
||||
}
|
||||
|
||||
func (t *dockerfileTask) dockerfile(ctx context.Context, pctx *plancontext.Context, s solver.Solver, v *compiler.Value) (*compiler.Value, error) {
|
||||
lg := log.Ctx(ctx)
|
||||
|
||||
// Read auth info
|
||||
@@ -74,7 +60,7 @@ func (t *dockerfileTask) dockerfile(ctx context.Context, pctx *plancontext.Conte
|
||||
dockerfileDef := contextDef
|
||||
|
||||
// Support inlined dockerfile
|
||||
if dockerfile := v.Lookup("dockerfile.contents"); dockerfile.Exists() {
|
||||
if dockerfile := v.Lookup("contents"); dockerfile.Exists() {
|
||||
contents, err := dockerfile.String()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -147,7 +133,7 @@ func (t *dockerfileTask) dockerfile(ctx context.Context, pctx *plancontext.Conte
|
||||
func (t *dockerfileTask) dockerBuildOpts(v *compiler.Value, pctx *plancontext.Context) (map[string]string, error) {
|
||||
opts := map[string]string{}
|
||||
|
||||
if dockerfilePath := v.Lookup("dockerfile.path"); dockerfilePath.Exists() {
|
||||
if dockerfilePath := v.Lookup("path"); dockerfilePath.Exists() {
|
||||
filename, err := dockerfilePath.String()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user