Fix server crash when running an image without command without autorun

Upstream-commit: 64d7bc442daa012683b38183c71674b9ecd660c2
Component: engine
This commit is contained in:
Guillaume J. Charmes
2013-05-02 13:56:45 -07:00
parent 1e4304b721
commit e6dd1bf4aa

View File

@ -127,7 +127,7 @@ func (runtime *Runtime) Create(config *Config) (*Container, error) {
runtime.mergeConfig(config, img.Config)
}
if config.Cmd == nil {
if config.Cmd == nil || len(config.Cmd) < 2 {
return nil, fmt.Errorf("No command specified")
}