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:
commit
085054db9d
3 changed files with 9 additions and 8 deletions
|
@ -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))
|
||||
}
|
||||
|
|
|
@ -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).
|
||||
|
@ -22,7 +25,7 @@ For a complete list of patches, fixes, and other improvements, see the
|
|||
container to writing to volumes [PR# 10093](https://github.com/docker/docker/pull/10093).
|
||||
* A new `docker stats CONTAINERID` command has been added to allow users to view a
|
||||
continuously updating stream of container resource usage statistics. See the
|
||||
[`stats` command line reference](/reference/commandline/cli/#stats) and the
|
||||
[`stats` command line reference](/reference/commandline/cli/#stats) and the
|
||||
[container `stats` API reference](/reference/api/docker_remote_api_v1.17/#get-container-stats-based-on-resource-usage).
|
||||
**Note**: this feature is only enabled for the `libcontainer` exec-driver at this point.
|
||||
* Users can now specify the file to use as the `Dockerfile` by running
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue