Skip to content

Commit 05867db

Browse files
authored
Merge pull request #122 from fluxcd/dns-fix
Add minimal nsswitch.conf
2 parents 478c7ec + 4e243ca commit 05867db

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ RUN apk add --no-cache ca-certificates tini
2727

2828
COPY --from=builder /workspace/source-controller /usr/local/bin/
2929

30+
# Create minimal nsswitch.conf file to prioritize the usage of /etc/hosts over DNS queries.
31+
# https://github.com/gliderlabs/docker-alpine/issues/367#issuecomment-354316460
32+
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf
33+
3034
RUN addgroup -S controller && adduser -S -g controller controller
3135

3236
USER controller

0 commit comments

Comments
 (0)