2019-01-15 15:57:53 +00:00
|
|
|
FROM golang:1.11-stretch AS builder
|
2018-12-20 11:06:26 +00:00
|
|
|
WORKDIR /go/src/github.com/pusher/oauth2_proxy
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
# Fetch dependencies
|
2019-01-15 15:57:53 +00:00
|
|
|
RUN wget -O dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64
|
|
|
|
RUN chmod +x dep
|
|
|
|
RUN mv dep $GOPATH/bin/dep
|
2018-12-20 11:06:26 +00:00
|
|
|
RUN dep ensure --vendor-only
|
|
|
|
|
|
|
|
# Build image
|
2019-01-04 10:58:30 +00:00
|
|
|
RUN ./configure && make clean oauth2_proxy
|
2018-12-20 11:06:26 +00:00
|
|
|
|
2019-01-04 10:58:30 +00:00
|
|
|
# Copy binary to debian
|
|
|
|
FROM debian:stretch
|
2018-12-20 11:06:26 +00:00
|
|
|
COPY --from=builder /go/src/github.com/pusher/oauth2_proxy/oauth2_proxy /bin/oauth2_proxy
|
|
|
|
|
|
|
|
ENTRYPOINT ["/bin/oauth2_proxy"]
|