run as non root and non host network mode

This commit is contained in:
yusing
2025-01-31 06:32:09 +08:00
parent 357897a0cd
commit b3290e2665
15 changed files with 107 additions and 73 deletions

View File

@@ -41,7 +41,7 @@ func TestHTTPConfigDeserialize(t *testing.T) {
if err != nil {
ExpectNoError(t, err)
}
ExpectDeepEqual(t, cfg.HTTPConfig, &tt.expected)
ExpectDeepEqual(t, cfg.HTTPConfig, tt.expected)
})
}
}

View File

@@ -116,6 +116,11 @@ func (e *RawEntry) Finalize() {
}
}
switch e.Host {
case "localhost", "127.0.0.1", "[::1]":
e.Host = "host.docker.internal"
}
if e.Scheme == "" && isDocker {
switch {
case e.Host == cont.PublicIP && cont.PublicPortMapping[pp].Type == "udp":