1
0
Fork 0
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:
Tibor Vass 2014-09-23 13:42:55 -04:00
commit 5ce7ee61ef
2 changed files with 17 additions and 1 deletions

View file

@ -150,7 +150,7 @@ func (b *Builder) Run(context io.Reader) (string, error) {
b.dockerfile = ast
// 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{}{}
for i, n := range b.dockerfile.Children {

View file

@ -2126,3 +2126,19 @@ func TestBuildClearCmd(t *testing.T) {
}
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")
}