@@ -1,5 +1,7 @@
11# This ARG has to be at the top, otherwise the docker daemon does not known what to do with FROM ${RUNTIME_IMAGE}
22ARG RUNTIME_IMAGE=gcr.io/distroless/static:nonroot
3+# version is shared between mutiple buildstages
4+ARG VERSION
35
46# All builds should be done using the platform native to the build node to allow
57# cache sharing of the go mod download step.
@@ -19,7 +21,6 @@ COPY . .
1921
2022# Arguments go here so that the previous steps can be cached if no external
2123# sources have changed.
22−ARG VERSION
2324ARG TARGETPLATFORM
2425ARG BUILDPLATFORM
2526
@@ -33,7 +34,7 @@ ARG BUILDPLATFORM
3334# automatically set by the docker engine.
3435RUN case ${TARGETPLATFORM} in \
3536 "linux/amd64") GOARCH=amd64 ;; \
36− # arm64 and arm64v8 are equivilant in go and do not require a goarm
37+ # arm64 and arm64v8 are equivalent in go and do not require a goarm
3738 # https://github.com/golang/go/wiki/GoArm
3839 "linux/arm64" | "linux/arm/v8") GOARCH=arm64 ;; \
3940 "linux/ppc64le") GOARCH=ppc64le ;; \
@@ -46,7 +47,17 @@ RUN case ${TARGETPLATFORM} in \
4647
4748# Copy binary to runtime image
4849FROM ${RUNTIME_IMAGE}
50+ARG VERSION
51+
4952COPY --from=builder /go/src/github.com/oauth2-proxy/oauth2-proxy/oauth2-proxy /bin/oauth2-proxy
5053COPY --from=builder /go/src/github.com/oauth2-proxy/oauth2-proxy/jwt_signing_key.pem /etc/ssl/private/jwt_signing_key.pem
5154
55+LABEL org.opencontainers.image.licenses=MIT \
56+ org.opencontainers.image.description="A reverse proxy that provides authentication with Google, Azure, OpenID Connect and many more identity providers." \
57+ org.opencontainers.image.documentation=https://oauth2-proxy.github.io/oauth2-proxy/ \
58+ org.opencontainers.image.source=https://github.com/oauth2-proxy/oauth2-proxy \
59+ org.opencontainers.image.url=https://quay.io/oauth2-proxy/oauth2-proxy \
60+ org.opencontainers.image.title=oauth2-proxy \
61+ org.opencontainers.image.version=${VERSION}
62+
5263ENTRYPOINT ["/bin/oauth2-proxy"]