We're using registrator for our service discovery and we recently stumble into an issue related to service names and ports. So we had this image which exposed two ports (80, 443), so when containers were launched using that image services were registered with the port being part of the service name. So for containers created with this image, and launched like this:
docker run -P crakmedia/php56-fpm-nginx
services names were php56-fpm-nginx-443 and php56-fpm-nginx-80. Following this name convention we configured consul-template to look for services names with a given port number. This far all was good.
Recently we modify our base image to no longer expose port 443, and this of course broke our consul-template configuration since service names does not include the port number when a single port has been published. This is per-se not a bug but it would be nice if service name was consistent. At the same time I'm aware that forcing the port into the service name will break existing setups. I was thinking that an option could be added to registrator to always force ports.
What do you think?
I could create a PR for it if you find it suitable.
Hi there,
We're using registrator for our service discovery and we recently stumble into an issue related to service names and ports. So we had this image which exposed two ports (80, 443), so when containers were launched using that image services were registered with the port being part of the service name. So for containers created with this image, and launched like this:
docker run -P crakmedia/php56-fpm-nginx
services names were php56-fpm-nginx-443 and php56-fpm-nginx-80. Following this name convention we configured consul-template to look for services names with a given port number. This far all was good.
Recently we modify our base image to no longer expose port 443, and this of course broke our consul-template configuration since service names does not include the port number when a single port has been published. This is per-se not a bug but it would be nice if service name was consistent. At the same time I'm aware that forcing the port into the service name will break existing setups. I was thinking that an option could be added to registrator to always force ports.
What do you think?
I could create a PR for it if you find it suitable.
Bests,
Yoanis.