Skip to content

Commit

Permalink
Dockerfile: add nsswitch.conf, update go and dep
Browse files Browse the repository at this point in the history
  • Loading branch information
ploxiln committed Feb 19, 2020
1 parent c6cb5ea commit 12effa1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM golang:1.12-alpine
FROM golang:1.13-alpine

RUN apk update && apk add git
RUN wget -O /usr/local/bin/dep \
https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 \
https://github.com/golang/dep/releases/download/v0.5.4/dep-linux-amd64 \
&& chmod a+x /usr/local/bin/dep

WORKDIR $GOPATH/src/github.com/ploxiln/oauth2_proxy/
Expand All @@ -14,7 +14,13 @@ RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /usr/local/bin/oauth2_proxy
FROM busybox

EXPOSE 4180

# set up nsswitch.conf for Go's "netgo" implementation
# https://github.com/golang/go/issues/35305
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf

COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=0 /usr/local/bin/oauth2_proxy /usr/local/bin/

USER www-data
CMD ["oauth2_proxy"]

0 comments on commit 12effa1

Please sign in to comment.