Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure Go binaries use /etc/hosts first.
Go <1.16 has unexpected default behavior when the /etc/nsswitch.conf file is missing: It will default to making a network request before looking in local files like /etc/hosts. Unfortunately the very popular alpine images do not have /etc/nsswitch.conf by default and so we must create one ourselves. There are many reports of this causing issues with name resolution: golang/go#22846 golang/go#35305 Until this is fixed in a released version of Go (hopefully 1.16) we need this change to ensure lookups happen in the expected way (files and then network). Change-Id: I246a767ae2767f0f83bf3b4229938a292cf9737e
- Loading branch information