FROM openshift/golang-builder:rhel_8_golang_1.15 AS builder
ENV __doozer=update BUILD_RELEASE=202111301700.p0.gfae6ace.assembly.stream BUILD_VERSION=v4.6.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=6 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.6.0-202111301700.p0.gfae6ace.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=fae6ace OS_GIT_VERSION=4.6.0-202111301700.p0.gfae6ace.assembly.stream-fae6ace SOURCE_DATE_EPOCH=1614200424 SOURCE_GIT_COMMIT=fae6ace52b865699ddd6dc4608ee3637ee4ee1b0 SOURCE_GIT_TAG=v0.3.1-142-gfae6ace5 SOURCE_GIT_URL=https://github.com/openshift/kube-rbac-proxy 
WORKDIR /go/src/github.com/brancz/kube-rbac-proxy
COPY . .
ENV GO111MODULE=on
# GOFLAGS is needed to build image without accessing external sources, mostly to comply with ART policies
ENV GOFLAGS="-mod=vendor"
RUN make build && \
    cp _output/kube-rbac-proxy-$(go env GOOS)-$(go env GOARCH) _output/kube-rbac-proxy

FROM openshift/ose-base:v4.6.0.20211130.171945
ENV __doozer=update BUILD_RELEASE=202111301700.p0.gfae6ace.assembly.stream BUILD_VERSION=v4.6.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=6 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.6.0-202111301700.p0.gfae6ace.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=fae6ace OS_GIT_VERSION=4.6.0-202111301700.p0.gfae6ace.assembly.stream-fae6ace SOURCE_DATE_EPOCH=1614200424 SOURCE_GIT_COMMIT=fae6ace52b865699ddd6dc4608ee3637ee4ee1b0 SOURCE_GIT_TAG=v0.3.1-142-gfae6ace5 SOURCE_GIT_URL=https://github.com/openshift/kube-rbac-proxy 

ARG FROM_DIRECTORY=/go/src/github.com/brancz/kube-rbac-proxy
COPY --from=builder ${FROM_DIRECTORY}/_output/kube-rbac-proxy  /usr/bin/kube-rbac-proxy

USER 65534
EXPOSE 8080
ENTRYPOINT ["/usr/bin/kube-rbac-proxy"]

LABEL \
        io.k8s.display-name="kube-rbac-proxy" \
        io.k8s.description="This is a proxy, that can perform Kubernetes RBAC authorization." \
        io.openshift.tags="kubernetes" \
        summary="" \
        maintainer="OpenShift Monitoring Team <team-monitoring@redhat.com>" \
        License="ASL 2.0" \
        vendor="Red Hat" \
        name="openshift/ose-kube-rbac-proxy" \
        com.redhat.component="kube-rbac-proxy-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Monitoring" \
        release="202111301700.p0.gfae6ace.assembly.stream" \
        io.openshift.build.commit.id="fae6ace52b865699ddd6dc4608ee3637ee4ee1b0" \
        io.openshift.build.source-location="https://github.com/openshift/kube-rbac-proxy" \
        io.openshift.build.commit.url="https://github.com/openshift/kube-rbac-proxy/commit/fae6ace52b865699ddd6dc4608ee3637ee4ee1b0" \
        version="v4.6.0"

