25 lines
No EOL
740 B
Docker
25 lines
No EOL
740 B
Docker
## Buildstage ##
|
|
FROM ghcr.io/linuxserver/baseimage-alpine:3.12 as buildstage
|
|
|
|
# The verison of oauth2-proxy to use
|
|
ARG PROXY_VERSION
|
|
# The architecture (amd64/arm64) to use
|
|
ARG ARCHITECTURE
|
|
|
|
RUN \
|
|
echo "**** downloading oauth2-proxy ****" && \
|
|
mkdir -p /root-layer && \
|
|
wget -O - \
|
|
https://github.com/oauth2-proxy/oauth2-proxy/releases/download/v$PROXY_VERSION/oauth2-proxy-v$PROXY_VERSION.linux-$ARCHITECTURE.tar.gz | \
|
|
tar -Ozxf - \
|
|
oauth2-proxy-v$PROXY_VERSION.linux-$ARCHITECTURE/oauth2-proxy > /root-layer/oauth2-proxy && \
|
|
chmod +x /root-layer/oauth2-proxy
|
|
|
|
# copy local files
|
|
COPY root/ /root-layer/
|
|
|
|
## Single layer deployed image ##
|
|
FROM scratch
|
|
|
|
# Add files from buildstage
|
|
COPY --from=buildstage /root-layer/ / |