Skip to content
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

Define docker hostname/DNS underscore behavior #2160

Closed
mostolog opened this issue Jan 19, 2017 · 5 comments
Closed

Define docker hostname/DNS underscore behavior #2160

mostolog opened this issue Jan 19, 2017 · 5 comments

Comments

@mostolog
Copy link

Hi

As discussed in moby/moby#27447 and suggested by @thaJeztah I file this issue in order to ask @docker for a clear statement on using underscores in container/services hostnames.

According to http://stackoverflow.com/a/2183140:

  • DNS spec allows underscores
  • Underscores aren't valid in hostnames
  • Docker compose/stack deploy/services append _X to names

With moby/swarmkit#1242 in mind, it would be great to know how underscores should be considered: Should docker binaries use "-" instead of "_" for compose/stack deploy/services instead? Might docker allow underscores in hostname but emit a warning if there are any?

Regards.

@thaJeztah
Copy link
Member

Keep in mind that my reference to this repository was for image distribution (e.g. docker pull _foo_bar.example.com:5000/repo/image:tag), which is separate from service names.

We removed the validation on hostnames for containers (moby/moby#28990), but hostnames are local to the container, so not the name under which containers can be "discovered".

@mostolog
Copy link
Author

@thaJeztah thanks for the clarification.
Have in mind hostname -f is used to return FQDN in relation with those issues. so I thought it worth it to mention.

@stevvooe
Copy link
Collaborator

@mostolog The grammar for image names does not allow _.

As far as moby/swarmkit#1242 is concerned, _ should only ever be used for DNS names that correspond to service records, as is required by DNS.

If compose/stack/deploy are pushing names that end up with _ in container hostnames, that bug needs to be fixed immediately, as it is very wrong.

@mostolog
Copy link
Author

@stevvooe should I report? Would you?

@stevvooe
Copy link
Collaborator

@mostolog I am not sure. Perhaps, the compose project would be the right place.

I am closing this issue, since we will not be adding support for underscores.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants