Generate an error on unknown Dockerfile instruction

Instead of just printing a warning and going on, this will generate
an error and stop processing.

This used to be part of #10561 but I decided it might need its own
independent discussion/PR as to not derail #10561.

Signed-off-by: Doug Davis <dug@us.ibm.com>
This commit is contained in:
Doug Davis
2015-03-13 16:08:34 -07:00
parent 52f6da2238
commit 8a5b50d65d
3 changed files with 9 additions and 8 deletions
+4 -4
View File
@@ -4343,16 +4343,16 @@ func TestBuildCmdJSONNoShDashC(t *testing.T) {
logDone("build - cmd should not have /bin/sh -c for json")
}
func TestBuildIgnoreInvalidInstruction(t *testing.T) {
func TestBuildErrorInvalidInstruction(t *testing.T) {
name := "testbuildignoreinvalidinstruction"
defer deleteImages(name)
out, _, err := buildImageWithOut(name, "FROM busybox\nfoo bar", true)
if err != nil {
t.Fatal(err, out)
if err == nil {
t.Fatalf("Should have failed: %s", out)
}
logDone("build - ignore invalid Dockerfile instruction")
logDone("build - error invalid Dockerfile instruction")
}
func TestBuildEntrypointInheritance(t *testing.T) {