mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #8179 from erikh/parser_fix_cmd_null
Parser fix cmd null
This commit is contained in:
commit
5ce7ee61ef
2 changed files with 17 additions and 1 deletions
|
@ -150,7 +150,7 @@ func (b *Builder) Run(context io.Reader) (string, error) {
|
||||||
b.dockerfile = ast
|
b.dockerfile = ast
|
||||||
|
|
||||||
// some initializations that would not have been supplied by the caller.
|
// some initializations that would not have been supplied by the caller.
|
||||||
b.Config = &runconfig.Config{Entrypoint: []string{}, Cmd: []string{"/bin/sh", "-c"}}
|
b.Config = &runconfig.Config{Entrypoint: []string{}, Cmd: nil}
|
||||||
b.TmpContainers = map[string]struct{}{}
|
b.TmpContainers = map[string]struct{}{}
|
||||||
|
|
||||||
for i, n := range b.dockerfile.Children {
|
for i, n := range b.dockerfile.Children {
|
||||||
|
|
|
@ -2126,3 +2126,19 @@ func TestBuildClearCmd(t *testing.T) {
|
||||||
}
|
}
|
||||||
logDone("build - clearcmd")
|
logDone("build - clearcmd")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestBuildEmptyCmd(t *testing.T) {
|
||||||
|
name := "testbuildemptycmd"
|
||||||
|
defer deleteImages(name)
|
||||||
|
if _, err := buildImage(name, "FROM scratch\nMAINTAINER quux\n", true); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
res, err := inspectFieldJSON(name, "Config.Cmd")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if res != "null" {
|
||||||
|
t.Fatalf("Cmd %s, expected %s", res, "null")
|
||||||
|
}
|
||||||
|
logDone("build - empty cmd")
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue