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

Dockerfile-release: add nsswitch.conf into image #7560

Merged
merged 1 commit into from
Mar 23, 2017

Conversation

artem-panchenko
Copy link
Contributor

The file '/etc/nsswitch.conf' is created in order to
take in account '/etc/hosts' entries while resolving
domain names inside docker container.

Closes #7559

The file '/etc/nsswitch.conf' is created in order to
take in account '/etc/hosts' entries while resolving
domain names.
# but Golang relies on /etc/nsswitch.conf to check the order of DNS resolving
# (see https://github.com/golang/go/commit/9dee7771f561cf6aee081c0af6658cc81fac3918)
# To fix this we just create /etc/nsswitch.conf and add the following line:
RUN echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why we do this order of files mdns4_minimal ...?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It possibly traces back to gliderlabs/docker-alpine#11

It seems like this is the canonical workaround

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, it's kind of a 'default' order (at least in Ubuntu), and I found this explanation pretty good https://ubuntuforums.org/showthread.php?t=971693&p=12589927#post12589927

@gyuho
Copy link
Contributor

gyuho commented Mar 23, 2017

Confirm that this fixes the issue #7559.

LGTM.

Thanks!

/cc @heyitsanthony

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

Successfully merging this pull request may close these issues.

3 participants