dockerfiles/oauth2-proxy/Dockerfile

26 lines
583 B
Docker
Raw Permalink Normal View History

FROM golang:alpine as builder
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 GOPATH /go
ENV OAUTH2_PROXY_VERSION v5.1.1
RUN go get github.com/pusher/oauth2_proxy || true \
&& cd /go/src/github.com/pusher/oauth2_proxy \
&& git checkout "${OAUTH2_PROXY_VERSION}" \
&& go build . \
&& 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" ]