Skip to content

Commit

Permalink
Add an nsswitch.conf file to help with file-based resolution
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
  • Loading branch information
hairyhenderson committed Jun 25, 2020
1 parent 2b08aec commit 4c35525
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions 2.0/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ RUN set -eux; \
chmod +x /usr/bin/caddy; \
caddy version

# set up nsswitch.conf for Go's "netgo" implementation
# - https://github.com/docker-library/golang/blob/master/1.14/alpine3.12/Dockerfile#L9
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf

# See https://caddyserver.com/docs/conventions#file-locations for details
ENV XDG_CONFIG_HOME=/config
ENV XDG_DATA_HOME=/data
Expand Down
4 changes: 4 additions & 0 deletions 2.1/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ RUN set -eux; \
chmod +x /usr/bin/caddy; \
caddy version

# set up nsswitch.conf for Go's "netgo" implementation
# - https://github.com/docker-library/golang/blob/master/1.14/alpine3.12/Dockerfile#L9
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf

# See https://caddyserver.com/docs/conventions#file-locations for details
ENV XDG_CONFIG_HOME=/config
ENV XDG_DATA_HOME=/data
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ RUN set -eux; \
chmod +x /usr/bin/caddy; \
caddy version

# set up nsswitch.conf for Go's "netgo" implementation
# - https://github.com/docker-library/golang/blob/master/1.14/alpine3.12/Dockerfile#L9
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf

# See https://caddyserver.com/docs/conventions#file-locations for details
ENV XDG_CONFIG_HOME=/config
ENV XDG_DATA_HOME=/data
Expand Down

0 comments on commit 4c35525

Please sign in to comment.