Skip to content

Commit

Permalink
Dockerfile: add nsswitch.conf so go resolver uses /etc/hosts first
Browse files Browse the repository at this point in the history
go upstream might fix this soon, but for now it is rather surprising
see golang/go#35305
  • Loading branch information
ploxiln committed Feb 20, 2020
1 parent 58f65c0 commit ce7706d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ EXPOSE 4150 4151 4160 4161 4170 4171
RUN mkdir -p /data
WORKDIR /data

# set up nsswitch.conf for Go's "netgo" implementation
# https://github.com/golang/go/issues/35305
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf

# Optional volumes (explicitly configure with "docker run -v ...")
# /data - used by nsqd for persistent storage across restarts
# /etc/ssl/certs - for SSL Root CA certificates from host
Expand Down

0 comments on commit ce7706d

Please sign in to comment.