diff --git a/.docker/Dockerfile-alpine b/.docker/Dockerfile-alpine index e8d26f999bc..075a1a75328 100644 --- a/.docker/Dockerfile-alpine +++ b/.docker/Dockerfile-alpine @@ -7,6 +7,10 @@ RUN addgroup -S ory; \ COPY hydra /usr/bin/hydra +# set up nsswitch.conf for Go's "netgo" implementation +# - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275 +RUN echo 'hosts: files dns' > /etc/nsswitch.conf + # By creating the sqlite folder as the ory user, the mounted volume will be owned by ory:ory, which # is required for read/write of SQLite. RUN mkdir -p /var/lib/sqlite && \ diff --git a/.docker/Dockerfile-scratch b/.docker/Dockerfile-scratch index e9798de37e5..f262b7c6338 100644 --- a/.docker/Dockerfile-scratch +++ b/.docker/Dockerfile-scratch @@ -3,6 +3,10 @@ FROM alpine:3.20 RUN apk upgrade --no-cache && \ apk add --no-cache --upgrade ca-certificates +# set up nsswitch.conf for Go's "netgo" implementation +# - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275 +RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf + RUN addgroup -S ory; \ adduser -S ory -G ory -D -h /home/ory -s /bin/nologin;