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 · 4 comments

Comments

@flxsource
Copy link

commented Nov 24, 2016

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

commented Jan 25, 2017

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

@samoht

This comment has been minimized.

Copy link
Contributor

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 Jan 30, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.