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

fix(docker): Add nsswitch.conf into the dockerfiles #1816

Merged
merged 1 commit into from
Apr 23, 2020

Conversation

silveraid
Copy link
Contributor

Go's netgo implementation currently does not respect hostname overrides
defined in /etc/hosts if the /etc/nsswitch.conf does not exists.

Made changes to the Dockerfiles to add a standard /etc/nsswitch.conf
to fix this issue.

Related issue

No issue have been opened for this.

Proposed changes

When hydra is being used in a form of a docker image in an environment where hostname overrides are being used through /etc/hosts the overrides are not respected. This is not an issue with hydra all, but a well known one with golang and alpine, as the alpine base image a few years ago got rid of the nsswitch.conf saying that it is not needed anymore. Unfortunately golang depends on the presence of this file and when it is missing it just ignores whatever is in the /etc/hosts file.

This change adds the nsswitch.conf back to the docker image of hydra.

Checklist

  • I have read the contributing guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security. vulnerability, I
    confirm that I got green light (please contact
    security@ory.sh) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

Further comments

Go's netgo implementation currently does not respect hostname overrides
defined in /etc/hosts if the /etc/nsswitch.conf does not exists.

Made changes to the Dockerfiles to add a standard /etc/nsswitch.conf
to fix this issue.
@CLAassistant
Copy link

CLAassistant commented Apr 22, 2020

CLA assistant check
All committers have signed the CLA.

@aeneasr
Copy link
Member

aeneasr commented Apr 23, 2020

Is it this issue golang/go#35305?

@aeneasr
Copy link
Member

aeneasr commented Apr 23, 2020

Looks like it!

@aeneasr aeneasr merged commit 48cf366 into ory:master Apr 23, 2020
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

Successfully merging this pull request may close these issues.

3 participants