From 4e243ca4de940b03addde0ad100a7fb08febbaab Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Mon, 31 Aug 2020 15:21:48 +0300 Subject: [PATCH] Add minimal nsswitch.conf --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 866108ba..46f60e1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,6 +27,10 @@ RUN apk add --no-cache ca-certificates tini COPY --from=builder /workspace/source-controller /usr/local/bin/ +# Create minimal nsswitch.conf file to prioritize the usage of /etc/hosts over DNS queries. +# https://github.com/gliderlabs/docker-alpine/issues/367#issuecomment-354316460 +RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf + RUN addgroup -S controller && adduser -S -g controller controller USER controller