Commit fe48b18e authored by duanjinfei's avatar duanjinfei

update docker server config parse

parent 424cf4d5
...@@ -68,7 +68,7 @@ func checkDockerServer(rawURL string) (bool, string) { ...@@ -68,7 +68,7 @@ func checkDockerServer(rawURL string) (bool, string) {
// 提取协议、主机和端口信息 // 提取协议、主机和端口信息
protocol := parsedURL.Scheme protocol := parsedURL.Scheme
if parsedURL.Scheme != "" && protocol != "tcp" { if parsedURL.Scheme != "" && protocol != "tcp" {
return false, "" protocol = "tcp://"
} }
ip := "host.docker.internal" ip := "host.docker.internal"
port := "2375" port := "2375"
...@@ -78,6 +78,6 @@ func checkDockerServer(rawURL string) (bool, string) { ...@@ -78,6 +78,6 @@ func checkDockerServer(rawURL string) (bool, string) {
if parsedURL.Host != "" { if parsedURL.Host != "" {
ip = parsedURL.Host ip = parsedURL.Host
} }
newUrl := fmt.Sprintf("tcp://%s:%s", ip, port) newUrl := fmt.Sprintf("%s%s:%s", ip, port, protocol)
return true, newUrl return true, newUrl
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment