Skip to content

Commit

Permalink
curl latest oauth2-proxy binary from github releases
Browse files Browse the repository at this point in the history
  • Loading branch information
rsnider-chg committed Feb 20, 2024
1 parent ca22edc commit 813f0be
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ COPY package* ./
RUN npm install --omit=dev
COPY dist ./

FROM golang:latest as go
RUN go install -v github.com/oauth2-proxy/oauth2-proxy/v7@latest
FROM alpine:latest as alpine
ARG TARGETPLATFORM
ENV PROXY_VERSION=v7.6.0
ENV TARGETPLATFORM=$TARGETPLATFORM
RUN curl -L https://github.com/oauth2-proxy/oauth2-proxy/releases/download/${PROXY_VERSION}/oauth2-proxy-${PROXY_VERSION}.$(echo ${TARGETPLATFORM//\//\-} ).tar.gz --output oauth2-proxy.tar.gz
RUN tar -xvzf oauth2-proxy.tar.gz
RUN mv oauth2-proxy-${PROXY_VERSION}.$(echo ${TARGETPLATFORM//\//\-} ) /bin/oauth2-proxy

FROM node:18-alpine
# https://stackoverflow.com/questions/66963068/docker-alpine-executable-binary-not-found-even-if-in-path
Expand All @@ -18,7 +23,7 @@ ARG ALTERNATE_PORT=8081
ARG PORT=3000
ARG OAUTH2_PROXY_SKIP_AUTH_ROUTES='/metrics,/health,/docs'
WORKDIR /app
COPY --from=go /go/bin/oauth2-proxy ./
COPY --from=alpine /bin/oauth2-proxy ./
COPY --from=build /app ./
COPY docker-entrypoint.sh .
ENV NODE_ENV="production" \
Expand Down

0 comments on commit 813f0be

Please sign in to comment.