update oauth2 proxy

fixes #415

Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
Jess Frazelle 2018-09-14 15:35:18 -04:00
parent 095a52053e
commit 35e8964699
No known key found for this signature in database
GPG Key ID: 18F3685C0022BFF3

View File

@ -1,35 +1,28 @@
FROM alpine:latest FROM golang:alpine as builder
LABEL maintainer "Jessie Frazelle <jess@linux.com>" LABEL maintainer "Jessie Frazelle <jess@linux.com>"
RUN apk --no-cache add \
ca-certificates \
git
ENV PATH /go/bin:/usr/local/go/bin:$PATH ENV PATH /go/bin:/usr/local/go/bin:$PATH
ENV GOPATH /go ENV GOPATH /go
RUN apk --no-cache add \
ca-certificates
ENV OAUTH2_PROXY_VERSION v2.2 ENV OAUTH2_PROXY_VERSION v2.2
RUN buildDeps=' \ RUN go get github.com/bitly/oauth2_proxy || true \
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 \
&& cd /go/src/github.com/bitly/oauth2_proxy \ && cd /go/src/github.com/bitly/oauth2_proxy \
&& git checkout "${OAUTH2_VERSION}" \ && git checkout "${OAUTH2_VERSION}" \
&& go get -d github.com/bitly/oauth2_proxy || true \ && go get -d github.com/bitly/oauth2_proxy || true \
&& go get gopkg.in/fsnotify/fsnotify.v1 \ && go get gopkg.in/fsnotify/fsnotify.v1 \
&& mv "${GOPATH}/src/gopkg.in/fsnotify/fsnotify.v1" "${GOPATH}/src/gopkg.in/fsnotify.v1" \ && mv "${GOPATH}/src/gopkg.in/fsnotify/fsnotify.v1" "${GOPATH}/src/gopkg.in/fsnotify.v1" \
&& go build \ && go build \
&& mv oauth2_proxy /usr/bin/ \ && mv oauth2_proxy /usr/bin/
&& apk del $buildDeps \
&& rm -rf /go \
&& echo "Build complete."
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" ] ENTRYPOINT [ "oauth2_proxy" ]