From 35e8964699298ee6c53c78f034a499de5dc7c558 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Fri, 14 Sep 2018 15:35:18 -0400 Subject: [PATCH] update oauth2 proxy fixes #415 Signed-off-by: Jess Frazelle --- oauth2-proxy/Dockerfile | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/oauth2-proxy/Dockerfile b/oauth2-proxy/Dockerfile index b547f5c..6e9da33 100644 --- a/oauth2-proxy/Dockerfile +++ b/oauth2-proxy/Dockerfile @@ -1,35 +1,28 @@ -FROM alpine:latest +FROM golang:alpine as builder LABEL maintainer "Jessie Frazelle " +RUN apk --no-cache add \ + ca-certificates \ + git + ENV PATH /go/bin:/usr/local/go/bin:$PATH ENV GOPATH /go -RUN apk --no-cache add \ - ca-certificates - ENV OAUTH2_PROXY_VERSION v2.2 -RUN buildDeps=' \ - go \ - git \ - gcc \ - g++ \ - libc-dev \ - libgcc \ - ' \ - set -x \ - && apk --no-cache add --repository https://dl-3.alpinelinux.org/alpine/edge/community $buildDeps \ - && go get github.com/bitly/oauth2_proxy || true \ +RUN go get github.com/bitly/oauth2_proxy || true \ && cd /go/src/github.com/bitly/oauth2_proxy \ && git checkout "${OAUTH2_VERSION}" \ && go get -d github.com/bitly/oauth2_proxy || true \ && go get gopkg.in/fsnotify/fsnotify.v1 \ && mv "${GOPATH}/src/gopkg.in/fsnotify/fsnotify.v1" "${GOPATH}/src/gopkg.in/fsnotify.v1" \ && go build \ - && mv oauth2_proxy /usr/bin/ \ - && apk del $buildDeps \ - && rm -rf /go \ - && echo "Build complete." + && mv oauth2_proxy /usr/bin/ +FROM alpine:latest + +COPY --from=builder /usr/bin/oauth2_proxy /usr/bin/oauth2_proxy +COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs + ENTRYPOINT [ "oauth2_proxy" ]