mirror of
https://github.com/moby/buildkit.git
synced 2026-08-07 00:00:52 +00:00
Merge pull request #811 from tonistiigi/empty-stdin
buildctl: detect empty stdin with empty frontend
This commit is contained in:
@@ -214,10 +214,16 @@ func build(clicontext *cli.Context) error {
|
||||
|
||||
var def *llb.Definition
|
||||
if clicontext.String("frontend") == "" {
|
||||
if fi, _ := os.Stdin.Stat(); (fi.Mode() & os.ModeCharDevice) != 0 {
|
||||
return errors.Errorf("please specify --frontend or pipe LLB definition to stdin")
|
||||
}
|
||||
def, err = read(os.Stdin, clicontext)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(def.Def) == 0 {
|
||||
return errors.Errorf("empty definition sent to build. Specify --frontend instead?")
|
||||
}
|
||||
} else {
|
||||
if clicontext.Bool("no-cache") {
|
||||
solveOpt.FrontendAttrs["no-cache"] = ""
|
||||
|
||||
Reference in New Issue
Block a user