git.iko.soy/typeable/oauth2-proxy
on v3.2.0 help sign in
25 lines 713 B history raw
1FROM golang:1.12-stretch AS builder
3# Download tools
4RUN wget -O $GOPATH/bin/dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64
5RUN chmod +x $GOPATH/bin/dep
7# Copy sources
8WORKDIR $GOPATH/src/github.com/pusher/oauth2_proxy
9COPY . .
11# Fetch dependencies
12RUN dep ensure --vendor-only
14# Build binary
15RUN ./configure && make build
17# Copy binary to alpine
18FROM alpine:3.8
19COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
20COPY --from=builder /go/src/github.com/pusher/oauth2_proxy/oauth2_proxy /bin/oauth2_proxy
22RUN addgroup -S -g 2000 oauth2proxy && adduser -S -u 2000 oauth2proxy -G oauth2proxy
23USER oauth2proxy
25ENTRYPOINT ["/bin/oauth2_proxy"]