Explorar el Código

Merge pull request #4042 from crosbymichael/allow-empty-cmd

Improve no command handling
Guillaume J. Charmes hace 11 años
padre
commit
b42e669a19
Se han modificado 1 ficheros con 1 adiciones y 3 borrados
  1. 1 3
      runtime.go

+ 1 - 3
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")
 		return nil, nil, fmt.Errorf("No command specified")
 	}
 	}