Open cs-mahmoud-khateeb opened 6 years ago
I had exactly the same problem on AWS ECS. I tried to change network mode from bridge
to default
(which should be bridge too) and it works since then. I don't know why, so it is just a dirty workaround but it works for me.
@MartinMajor the setup I have is in AWS ECS. And that hack is the last thing I would ever think about! Thanks for sharing your solution. The way I have solved it is by passing the host IP to registrator upon start up and ask it to always use that IP. Ports aren't an issue as I mentioned in any of the networking mode.
I can suggest to try that.
I done this option for myself with some rework on project: https://gitlab.com/dkr-registrator/registrator/
Docker version: 17.06.2-ce Registrator version: v7 (image: gliderlabs/registrator:latest) running in
HOST
networking mode. Consul version: Consul v1.0.3 (image: consul) running inHOST
networking mode. Registrator command:/bin/registrator -internal=false consul://localhost:8500
Docker command:Command | ["-internal=false","consul://localhost:8500"]
Consul/Registrtor are working perfectly fine with services running on
HOST
networking mode, an example of this from/consul/data/services
inside registrator container:The problem is happening when trying to discover services running on
BRIDGE
networking mode, an example of this is the following which is showing an internal dockeraddress
rather than showing the host address which is172.30.x.x
, the weird thing is that it showing the exposed port of the host:I was expecting it to give back the host ip
172.30.x.x
:33510
rather than the internal docker ip172.17.x.x
:33510
espically that-internal=false
.Is there anything I am missing?