2019-01-15 15:57:53 +00:00
|
|
|
FROM golang:1.11-stretch AS builder
|
2019-01-21 17:50:50 +00:00
|
|
|
|
|
|
|
# Download tools
|
|
|
|
RUN wget -O $GOPATH/bin/dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64
|
|
|
|
RUN chmod +x $GOPATH/bin/dep
|
|
|
|
|
|
|
|
# Copy sources
|
|
|
|
WORKDIR $GOPATH/src/github.com/pusher/oauth2_proxy
|
2018-12-20 11:06:26 +00:00
|
|
|
COPY . .
|
|
|
|
|
|
|
|
# Fetch dependencies
|
|
|
|
RUN dep ensure --vendor-only
|
|
|
|
|
2019-01-21 17:50:50 +00:00
|
|
|
# Build binary
|
|
|
|
RUN ./configure && make build
|
2018-12-20 11:06:26 +00:00
|
|
|
|
2019-01-21 17:50:50 +00:00
|
|
|
# Copy binary to alpine
|
|
|
|
FROM alpine:3.8
|
2019-02-02 01:20:20 +00:00
|
|
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
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"]
|