mirror of
				https://github.com/1Panel-dev/1Panel.git
				synced 2025-10-31 11:15:58 +08:00 
			
		
		
		
	fix: 解决 Docker 重启失败的问题 (#6805)
This commit is contained in:
		
							parent
							
								
									52377b0042
								
							
						
					
					
						commit
						cf1d02771f
					
				
					 2 changed files with 4 additions and 1 deletions
				
			
		|  | @ -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) | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue