Skip to content
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

Add bare-bones "/etc/nsswitch.conf" for "netgo" to know it should check "/etc/hosts" before doing DNS lookups #84

Merged
merged 1 commit into from Oct 11, 2017
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions 17.06/Dockerfile
Expand Up @@ -3,6 +3,12 @@ FROM alpine:3.6
RUN apk add --no-cache \
ca-certificates

# set up nsswitch.conf for Go's "netgo" implementation (which Docker explicitly uses)
# - https://github.com/docker/docker-ce/blob/v17.09.0-ce/components/engine/hack/make.sh#L149
# - 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 DOCKER_CHANNEL stable
ENV DOCKER_VERSION 17.06.2-ce
# TODO ENV DOCKER_SHA256
Expand Down
6 changes: 6 additions & 0 deletions 17.07/Dockerfile
Expand Up @@ -3,6 +3,12 @@ FROM alpine:3.6
RUN apk add --no-cache \
ca-certificates

# set up nsswitch.conf for Go's "netgo" implementation (which Docker explicitly uses)
# - https://github.com/docker/docker-ce/blob/v17.09.0-ce/components/engine/hack/make.sh#L149
# - 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 DOCKER_CHANNEL edge
ENV DOCKER_VERSION 17.07.0-ce
# TODO ENV DOCKER_SHA256
Expand Down
6 changes: 6 additions & 0 deletions 17.09/Dockerfile
Expand Up @@ -3,6 +3,12 @@ FROM alpine:3.6
RUN apk add --no-cache \
ca-certificates

# set up nsswitch.conf for Go's "netgo" implementation (which Docker explicitly uses)
# - https://github.com/docker/docker-ce/blob/v17.09.0-ce/components/engine/hack/make.sh#L149
# - 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 DOCKER_CHANNEL stable
ENV DOCKER_VERSION 17.09.0-ce
# TODO ENV DOCKER_SHA256
Expand Down
6 changes: 6 additions & 0 deletions 17.10-rc/Dockerfile
Expand Up @@ -3,6 +3,12 @@ FROM alpine:3.6
RUN apk add --no-cache \
ca-certificates

# set up nsswitch.conf for Go's "netgo" implementation (which Docker explicitly uses)
# - https://github.com/docker/docker-ce/blob/v17.09.0-ce/components/engine/hack/make.sh#L149
# - 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 DOCKER_CHANNEL test
ENV DOCKER_VERSION 17.10.0-ce-rc1
# TODO ENV DOCKER_SHA256
Expand Down
6 changes: 6 additions & 0 deletions Dockerfile.template
Expand Up @@ -3,6 +3,12 @@ FROM alpine:%%ALPINE-VERSION%%
RUN apk add --no-cache \
ca-certificates

# set up nsswitch.conf for Go's "netgo" implementation (which Docker explicitly uses)
# - https://github.com/docker/docker-ce/blob/v17.09.0-ce/components/engine/hack/make.sh#L149
# - 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 DOCKER_CHANNEL %%DOCKER-CHANNEL%%
ENV DOCKER_VERSION %%DOCKER-VERSION%%
# TODO ENV DOCKER_SHA256
Expand Down