| | |
| | | } |
| | | |
| | | // 安装Docker |
| | | installCommand := "sudo curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh && sudo systemctl restart docker" |
| | | installCommand := "sudo curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh && sudo systemctl start docker && sudo systemctl enable docker" |
| | | _, err = SSHExec(nodeIP, sshUsername, sshPassword, installCommand, sshPort) |
| | | if err != nil { |
| | | return fmt.Errorf("failed to install Docker on the remote server: %v", err) |
| | | return fmt.Errorf("failed to install Docker on the remote server:%v %v", nodeIP, err) |
| | | } |
| | | |
| | | fmt.Println("Docker has been installed on the remote server.") |