Skip to content

Dockerfile: Remove /etc/nsswitch.conf workaround #3685

@polarathene

Description

@polarathene

Preflight checklist

  • I could not find a solution in the existing issues, docs, nor discussions.
  • I agree to follow this project's Code of Conduct.
  • I have read and am following this repository's Contribution Guidelines.

Describe your problem

Some of the Dockerfile files in this repo (and likely other Ory projects) carry an old workaround (introduced in April 2020):

# set up nsswitch.conf for Go's "netgo" implementation
# - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275
RUN echo 'hosts: files dns' > /etc/nsswitch.conf

# set up nsswitch.conf for Go's "netgo" implementation
# - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf

This is no longer relevant since Alpine 3.16.3 which now includes /etc/nsswitch.conf, additionally since Go 1.16 the referenced logic has been changed to not prefer dns files, but instead files dns (preferring /etc/hosts before querying DNS).

Describe your ideal solution

Remove the relevant lines from the Dockerfile files across Ory projects.

Workarounds or alternatives

No issue, just communicating that the content is redundant to maintainers.

Version

2.1.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    featNew feature or request.staleFeedback from one or more authors is required to proceed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions