From 6c167214454ba41bea3775bd1bf73d7aa07c741c Mon Sep 17 00:00:00 2001 From: mritd Date: Fri, 13 Aug 2021 16:04:31 +0800 Subject: [PATCH] chore(docker): set up nsswitch.conf for Go's "netgo" implementation set up nsswitch.conf for Go's "netgo" implementation Signed-off-by: mritd --- Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index 0be5eeb..a0dee50 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,6 +28,11 @@ FROM alpine AS dist LABEL maintainer="mritd " +# 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 + # bash is used for debugging, tzdata is used to add timezone information. # Install ca-certificates to ensure no CA certificate errors. #