@@ -1,18 +1,22 @@
11FROM golang:1.11-stretch AS builder
2−WORKDIR /go/src/github.com/pusher/oauth2_proxy
2+
3+# Download tools
4+RUN wget -O $GOPATH/bin/dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64
5+RUN chmod +x $GOPATH/bin/dep
6+
7+# Copy sources
8+WORKDIR $GOPATH/src/github.com/pusher/oauth2_proxy
39COPY . .
410
511# Fetch dependencies
6−RUN wget -O dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64
7−RUN chmod +x dep
8−RUN mv dep $GOPATH/bin/dep
912RUN dep ensure --vendor-only
1013
11−# Build image
12−RUN ./configure && make clean oauth2_proxy
14+# Build binary
15+RUN ./configure && make build
1316
14−# Copy binary to debian
15−FROM debian:stretch
17+# Copy binary to alpine
18+FROM alpine:3.8
19+RUN apk add --no-cache ca-certificates
1620COPY --from=builder /go/src/github.com/pusher/oauth2_proxy/oauth2_proxy /bin/oauth2_proxy
1721
1822ENTRYPOINT ["/bin/oauth2_proxy"]