Skip to content

Add nsswitch.conf to Alpine images for "netgo" #217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion 1.10/alpine3.7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
FROM alpine:3.7

RUN apk add --no-cache ca-certificates
RUN apk add --no-cache \
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appears unchanged in 1.10.2 (which is a good sign for this PR). 👍

# - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf

ENV GOLANG_VERSION 1.10.2

Expand Down
8 changes: 7 additions & 1 deletion 1.9/alpine3.6/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
FROM alpine:3.6

RUN apk add --no-cache ca-certificates
RUN apk add --no-cache \
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
# - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf

ENV GOLANG_VERSION 1.9.6

Expand Down
8 changes: 7 additions & 1 deletion 1.9/alpine3.7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
FROM alpine:3.7

RUN apk add --no-cache ca-certificates
RUN apk add --no-cache \
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
# - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf

ENV GOLANG_VERSION 1.9.6

Expand Down
8 changes: 7 additions & 1 deletion Dockerfile-alpine.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
FROM alpine:%%TAG%%

RUN apk add --no-cache ca-certificates
RUN apk add --no-cache \
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
# - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf

ENV GOLANG_VERSION %%VERSION%%

Expand Down