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

Docker for Mac doesn't read hosts /etc/hosts correctly when using aliases #983

Closed
flxsource opened this issue Nov 24, 2016 · 5 comments
Closed

Comments

@flxsource
Copy link

Expected behavior

Docker Engine is able to resolve the host name and any aliases declared in the /etc/hosts file on the host OS.

Actual behavior

Docker Engine is only able to resolve the host name, but not any aliases.

Information

Diagnostic ID: AF53934A-7F40-4AAA-82E7-6093DE58E779

We are running a Docker registry on our internal network, and a second registry configured as a pull through cache on the same machine, but under a different hostname. The two hostnames used are currently NOT in DNS, so modifying the /etc/hosts file is required.

The problem is that when using the format [IP Address] [Hostname] [Aliases] in /etc/hosts Docker Engine is only able to resolve the [Hostname], not any of the [Aliases]. If the line is split to be multiple [IP Address] [Hostname] then Docker Engine is correctly able to resolve all of them.

Steps to reproduce the behavior

  1. Set up a registry as a pull through cache
  2. Declare the IP and hostname in /etc/hosts (a bogus hostname can be provided, to then allow the correct hostname to be declared as an alias.
  3. Configure Docker for Mac to use the registry as a mirror, using the hostname declared as an alias
  4. Attempt to pull an image that has not already been pulled onto the local host
@rogaha
Copy link

rogaha commented Nov 25, 2016

@flxsource thanks for the reporting the issue, I've raised another issue on the vpnkit repository: moby/vpnkit#162. We will let you know as soon as it gets fixed!

@djs55
Copy link
Contributor

djs55 commented Jan 12, 2017

I've merged a fix for this into the master branch which should be released in beta 37, due in a couple of weeks.

@yallop
Copy link
Contributor

yallop commented Jan 25, 2017

@flxsource, could you please confirm that the latest beta (39) resolves the problem?

@samoht
Copy link
Contributor

samoht commented Jan 30, 2017

Both stable and channels should now contain the fix, so closing. @flxsource please re-open that issue if the fix doesn't work for you. Thanks!

@samoht samoht closed this as completed Jan 30, 2017
@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Jun 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants