1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #10591 from duglin/ErrUnknownCmd

Generate an error on unknown Dockerfile instruction
This commit is contained in:
Tibor Vass 2015-03-16 17:47:28 -04:00
commit 085054db9d
3 changed files with 9 additions and 8 deletions

View file

@ -309,7 +309,5 @@ func (b *Builder) dispatch(stepN int, ast *parser.Node) error {
return f(b, strList, attrs, original)
}
fmt.Fprintf(b.ErrStream, "# Skipping unknown instruction %s\n", strings.ToUpper(cmd))
return nil
return fmt.Errorf("Unknown instruction: %s", strings.ToUpper(cmd))
}

View file

@ -15,6 +15,9 @@ For a complete list of patches, fixes, and other improvements, see the
*New Features*
* [1.6] The Docker daemon will no longer ignore unknown commands
while processing a `Dockerfile`. Instead it will generate an error and halt
processing.
* The Docker daemon has now supports for IPv6 networking between containers
and on the `docker0` bridge. For more information see the
[IPv6 networking reference](/articles/networking/#ipv6).

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) {