gliderlabs / registrator

Service registry bridge for Docker with pluggable adapters
http://gliderlabs.com/registrator
MIT License
4.66k stars 912 forks source link

Use IP address in UniqueID (ServiceID)? #499

Open cookandy opened 7 years ago

cookandy commented 7 years ago

Hello,

According to this section of the documentation, the UniqueID or ServiceID uses the machine's hostname in the ID:

Registrator comes up with a human-friendly string that encodes useful information in the ID based on this pattern: <hostname>:<container-name>:<exposed-port>[:udp if udp] The ID includes the hostname to help you identify which host this service is running on.

Is it possible to make registrator use the IP address in the ServiceID, instead of the hostname? I have tried starting registrator with -ip <IP address>, but it still seems to register services in Consul with the hostname.

I am using Registrator v7.

Thanks!

gvenka008c commented 7 years ago

@cookandy @here I am looking for the same as above. Is there a way we can make registrator use the Host IP address in the ServiceID (container ID)?

hijak commented 6 years ago

+1 if we can edit just the service id part

because in a swarm environment this is uniq to the host