2019-02-01 23:08:19 +00:00
|
|
|
FROM golang:1.11-stretch AS builder
|
|
|
|
|
|
|
|
# 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
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
# Fetch dependencies
|
|
|
|
RUN dep ensure --vendor-only
|
|
|
|
|
|
|
|
# Build binary
|
|
|
|
RUN ./configure && GOARCH=arm GOARM=6 make build
|
|
|
|
|
|
|
|
# Copy binary to alpine
|
|
|
|
FROM arm32v6/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
|
2019-02-01 23:08:19 +00:00
|
|
|
COPY --from=builder /go/src/github.com/pusher/oauth2_proxy/oauth2_proxy /bin/oauth2_proxy
|
|
|
|
|
2019-03-05 08:26:49 +00:00
|
|
|
RUN addgroup -S -g 2000 oauth2proxy && adduser -S -u 2000 oauth2proxy -G oauth2proxy
|
|
|
|
USER oauth2proxy
|
|
|
|
|
2019-02-01 23:08:19 +00:00
|
|
|
ENTRYPOINT ["/bin/oauth2_proxy"]
|