Fix server crash when running an image without command without autorun
Upstream-commit: 64d7bc442daa012683b38183c71674b9ecd660c2 Component: engine
This commit is contained in:
@ -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")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user