Merge pull request #952 from thaJeztah/18.09_backport_fix_empty_dockerfile
[18.09 backport] Have parser error on dockerfiles without instructionsdocker-18.09
commit
05766c5c21
|
@ -275,6 +275,11 @@ func Parse(rwc io.Reader) (*Result, error) {
|
||||||
if len(warnings) > 0 {
|
if len(warnings) > 0 {
|
||||||
warnings = append(warnings, "[WARNING]: Empty continuation lines will become errors in a future release.")
|
warnings = append(warnings, "[WARNING]: Empty continuation lines will become errors in a future release.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if root.StartLine < 0 {
|
||||||
|
return nil, errors.New("file with no instructions.")
|
||||||
|
}
|
||||||
|
|
||||||
return &Result{
|
return &Result{
|
||||||
AST: root,
|
AST: root,
|
||||||
Warnings: warnings,
|
Warnings: warnings,
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
# Hello
|
||||||
|
# These are just comments
|
||||||
|
|
Loading…
Reference in New Issue