buildctl: detect empty stdin with empty frontend
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>docker-19.03
parent
ac64f29f63
commit
8344b342a1
|
@ -214,10 +214,16 @@ func build(clicontext *cli.Context) error {
|
||||||
|
|
||||||
var def *llb.Definition
|
var def *llb.Definition
|
||||||
if clicontext.String("frontend") == "" {
|
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)
|
def, err = read(os.Stdin, clicontext)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if len(def.Def) == 0 {
|
||||||
|
return errors.Errorf("empty definition sent to build. Specify --frontend instead?")
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if clicontext.Bool("no-cache") {
|
if clicontext.Bool("no-cache") {
|
||||||
solveOpt.FrontendAttrs["no-cache"] = ""
|
solveOpt.FrontendAttrs["no-cache"] = ""
|
||||||
|
|
Loading…
Reference in New Issue