mirror of
				https://github.com/thib8956/nginx-proxy
				synced 2025-11-04 02:59:20 +00:00 
			
		
		
		
	Support containers running --net=host (#1537)
Detect if a target container is running host networking, and if so, use the IP address of the first bridge net gateway.
This commit is contained in:
		@@ -67,6 +67,11 @@
 | 
			
		||||
    #         {{ .Name }} (ignored)
 | 
			
		||||
            {{- continue }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
        {{- if eq .Name "host" }}
 | 
			
		||||
    #         {{ .Name }} (host network; using {{ (index $.globals.CurrentContainer.Networks 0).Name }} gateway)
 | 
			
		||||
            {{- $ip = (index $.globals.CurrentContainer.Networks 0).Gateway }}
 | 
			
		||||
            {{- continue }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
        {{- if and (not (index $.globals.networks .Name)) (not $.globals.networks.host) }}
 | 
			
		||||
    #         {{ .Name }} (unreachable)
 | 
			
		||||
            {{- continue }}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user