2018-09-14 21:35:18 +02:00
|
|
|
FROM golang:alpine as builder
|
2017-03-22 20:29:18 +01:00
|
|
|
LABEL maintainer "Jessie Frazelle <jess@linux.com>"
|
|
|
|
|
2018-09-14 21:35:18 +02:00
|
|
|
RUN apk --no-cache add \
|
|
|
|
ca-certificates \
|
|
|
|
git
|
|
|
|
|
2017-03-22 20:29:18 +01:00
|
|
|
ENV PATH /go/bin:/usr/local/go/bin:$PATH
|
|
|
|
ENV GOPATH /go
|
|
|
|
|
2018-03-24 00:34:06 +01:00
|
|
|
ENV OAUTH2_PROXY_VERSION v2.2
|
2017-03-22 20:29:18 +01:00
|
|
|
|
2018-09-14 21:35:18 +02:00
|
|
|
RUN go get github.com/bitly/oauth2_proxy || true \
|
2017-03-22 20:29:18 +01:00
|
|
|
&& cd /go/src/github.com/bitly/oauth2_proxy \
|
|
|
|
&& git checkout "${OAUTH2_VERSION}" \
|
2018-03-23 17:10:57 +01:00
|
|
|
&& 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" \
|
2017-03-22 20:29:18 +01:00
|
|
|
&& go build \
|
2018-09-14 21:35:18 +02:00
|
|
|
&& mv oauth2_proxy /usr/bin/
|
|
|
|
|
|
|
|
|
|
|
|
FROM alpine:latest
|
2017-03-22 20:29:18 +01:00
|
|
|
|
2018-09-14 21:35:18 +02:00
|
|
|
COPY --from=builder /usr/bin/oauth2_proxy /usr/bin/oauth2_proxy
|
|
|
|
COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs
|
2017-03-22 20:29:18 +01:00
|
|
|
|
|
|
|
ENTRYPOINT [ "oauth2_proxy" ]
|