diff --git a/backend/app/service/docker.go b/backend/app/service/docker.go index b9cea2543..920657fff 100644 --- a/backend/app/service/docker.go +++ b/backend/app/service/docker.go @@ -426,6 +426,9 @@ func changeLogOption(daemonMap map[string]interface{}, logMaxFile, logMaxSize st } func validateDockerConfig() error { + if !cmd.Which("dockerd") { + return nil + } stdout, err := cmd.Exec("dockerd --validate") if err != nil || (stdout != "" && strings.TrimSpace(stdout) != "configuration OK") { return fmt.Errorf("Docker configuration validation failed, err: %v", stdout) diff --git a/backend/utils/cmd/cmd.go b/backend/utils/cmd/cmd.go index 46b20fc1f..cfadd3670 100644 --- a/backend/utils/cmd/cmd.go +++ b/backend/utils/cmd/cmd.go @@ -204,7 +204,7 @@ func SudoHandleCmd() string { func Which(name string) bool { stdout, err := Execf("which %s", name) - if err != nil || (len(strings.ReplaceAll(stdout, "\n", "")) == 0 && strings.HasPrefix(stdout, "/")) { + if err != nil || (len(strings.ReplaceAll(stdout, "\n", "")) == 0) { return false } return true