From 7fa913e51c56eb386af40e78aac67d572d37dc4f Mon Sep 17 00:00:00 2001 From: Joel Speed Date: Thu, 20 Dec 2018 11:06:26 +0000 Subject: [PATCH] Add Dockerfile --- CHANGELOG.md | 1 + Dockerfile | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 Dockerfile diff --git a/CHANGELOG.md b/CHANGELOG.md index ab04d80..68e17f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Changes since v2.2: +- Add Dockerfile - Fix fsnotify import - Update README to reflect new repository ownership - Update CI scripts to separate linting and testing diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..af11f4f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM golang:1.10 AS builder +WORKDIR /go/src/github.com/pusher/oauth2_proxy +COPY . . + +# Fetch dependencies +RUN go get -u github.com/golang/dep/cmd/dep +RUN dep ensure --vendor-only + +# Build image +RUN CGO_ENABLED=0 GOOS=linux go build + +# Copy binary to alpine +FROM alpine:3.8 +COPY --from=builder /go/src/github.com/pusher/oauth2_proxy/oauth2_proxy /bin/oauth2_proxy + +ENTRYPOINT ["/bin/oauth2_proxy"]