From 4ce6d81f0dd510dabacc05da1c85b5c933454055 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Mon, 10 Feb 2014 11:04:24 -0800 Subject: [PATCH] Improve no command handling Docker-DCO-1.1-Signed-off-by: Michael Crosby (github: crosbymichael) Upstream-commit: 44821158409d59024173336188e087c605e1da1a Component: engine --- components/engine/runtime.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/components/engine/runtime.go b/components/engine/runtime.go index 7e4ae79b40..a16238e200 100644 --- a/components/engine/runtime.go +++ b/components/engine/runtime.go @@ -378,9 +378,7 @@ func (runtime *Runtime) Create(config *Config, name string) (*Container, []strin } } - if len(config.Entrypoint) != 0 && config.Cmd == nil { - config.Cmd = []string{} - } else if config.Cmd == nil || len(config.Cmd) == 0 { + if len(config.Entrypoint) == 0 && len(config.Cmd) == 0 { return nil, nil, fmt.Errorf("No command specified") }