Merge pull request #122 from fluxcd/dns-fix

Add minimal nsswitch.conf
This commit is contained in:
Stefan Prodan 2020-08-31 15:48:24 +03:00 committed by GitHub
commit 05867db66f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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