New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of container name hostname for service name #267

Open
bergtwvd opened this Issue Oct 11, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@bergtwvd

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.
So the behavior could be, in the following order:

  1. use SERVICE_NAME (if set)
  2. use container name (if set)
  3. use hostname (if set)
  4. use image name

-- Tom

@Lawouach

This comment has been minimized.

Show comment
Hide comment
@Lawouach

Lawouach Oct 22, 2015

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:

  1. use hostname if set
  2. use container name if set
  3. use image name if set

As for the SERVICE_NAME... I'd drop its usage entirely.

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:

  1. use hostname if set
  2. use container name if set
  3. use image name if set

As for the SERVICE_NAME... I'd drop its usage entirely.

@bergtwvd

This comment has been minimized.

Show comment
Hide comment
@bergtwvd

bergtwvd Nov 3, 2015

Agree.

As I also use Weave DNS in some setups, I do not want different docker-compose YML files. I do not want to assume different container names depending on Weave, Consul or some other DNS system.

bergtwvd commented Nov 3, 2015

Agree.

As I also use Weave DNS in some setups, I do not want different docker-compose YML files. I do not want to assume different container names depending on Weave, Consul or some other DNS system.

@mgood

This comment has been minimized.

Show comment
Hide comment
@mgood

mgood Nov 3, 2015

Contributor

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.

Contributor

mgood commented Nov 3, 2015

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.

@ketchoop

This comment has been minimized.

Show comment
Hide comment
@ketchoop

ketchoop Oct 14, 2016

Are there any news about this feature?

Are there any news about this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment