Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Use of container name hostname for service name #267
I wonder if it is possible to use the container name (if set) or otherwise the hostname (if set) as the service name to be used by the registrator. Now I need to adapt my docker-compose files and define the environment variable SERVICE_NAME, which makes my files dependent on the behaviour of registrator.
Well, I can only agree with this improvement.
However, the ordering is not what I'd choose. The problem is with orchestrators like mesos/marathon that set very opaque names to containers unfortunately.
Considering what registrator is used for, I would expect this ordering:
As for the SERVICE_NAME... I'd drop its usage entirely.
Thanks for the feedback. More flexibility in the default naming scheme would be good, but we need to think more about how exactly to support it, since people may need different defaults depending on their setup.
One issue with the container name is that the Docker API doesn't seem to offer a way to distinguish names set by the user from its own auto-generated names. So, using the container name in registrator would need to be an explicit option for users that know that they will always set the name.