mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-21 16:49:03 +01:00
fix port discovery for docker
This commit is contained in:
BIN
bin/go-proxy
BIN
bin/go-proxy
Binary file not shown.
@@ -46,7 +46,9 @@ func (p *Provider) getContainerProxyConfigs(container types.Container, clientIP
|
||||
if config.Port == "" && clientIP != "" {
|
||||
for _, port := range container.Ports {
|
||||
config.Port = fmt.Sprintf("%d", port.PublicPort)
|
||||
break
|
||||
if config.Port != "0" {
|
||||
break
|
||||
}
|
||||
}
|
||||
} else if config.Port == "" {
|
||||
// usually the smaller port is the http one
|
||||
@@ -63,7 +65,7 @@ func (p *Provider) getContainerProxyConfigs(container types.Container, clientIP
|
||||
}
|
||||
}
|
||||
}
|
||||
if config.Port == "" {
|
||||
if config.Port == "" || config.Port == "0" {
|
||||
// no ports exposed or specified
|
||||
p.Logf("Build", "no ports exposed for %s, ignored", container_name)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user