diff --git a/images/orderer/Dockerfile b/images/orderer/Dockerfile index 549464a1d00..1ca6adf0ffe 100644 --- a/images/orderer/Dockerfile +++ b/images/orderer/Dockerfile @@ -6,6 +6,10 @@ ARG GO_VER ARG ALPINE_VER FROM alpine:${ALPINE_VER} as base RUN apk add --no-cache tzdata +# set up nsswitch.conf for Go's "netgo" implementation +# - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275 +# - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf +RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf FROM golang:${GO_VER}-alpine${ALPINE_VER} as golang RUN apk add --no-cache \ diff --git a/images/peer/Dockerfile b/images/peer/Dockerfile index 19ce9140009..5ce9da4796e 100644 --- a/images/peer/Dockerfile +++ b/images/peer/Dockerfile @@ -7,6 +7,10 @@ ARG ALPINE_VER FROM alpine:${ALPINE_VER} as peer-base RUN apk add --no-cache tzdata +# set up nsswitch.conf for Go's "netgo" implementation +# - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275 +# - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf +RUN echo 'hosts: files dns' > /etc/nsswitch.conf FROM golang:${GO_VER}-alpine${ALPINE_VER} as golang RUN apk add --no-cache \