FROM openshift/golang-builder:1.12 AS builder
ENV __doozer=update BUILD_RELEASE=202006081335 BUILD_VERSION=v4.3.25 OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=25 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.3.25-202006081335 
ENV __doozer=merge OS_GIT_COMMIT=84e7dac OS_GIT_VERSION=4.3.25-202006081335-84e7dac SOURCE_DATE_EPOCH=1572513918 SOURCE_GIT_COMMIT=84e7dac69f8e3f90620729ee730327a3e168963d SOURCE_GIT_TAG=84e7dac6 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/linux/$(go env GOARCH)/kube-rbac-proxy _output/kube-rbac-proxy

FROM openshift/ose-base:v4.3.25.20200608.133509
ENV __doozer=update BUILD_RELEASE=202006081335 BUILD_VERSION=v4.3.25 OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=25 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.3.25-202006081335 
ENV __doozer=merge OS_GIT_COMMIT=84e7dac OS_GIT_VERSION=4.3.25-202006081335-84e7dac SOURCE_DATE_EPOCH=1572513918 SOURCE_GIT_COMMIT=84e7dac69f8e3f90620729ee730327a3e168963d SOURCE_GIT_TAG=84e7dac6 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 nobody
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" \
        maintainer="Frederic Branczyk <fbranczy@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" \
        version="v4.3.25" \
        release="202006081335" \
        io.openshift.build.commit.id="84e7dac69f8e3f90620729ee730327a3e168963d" \
        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/84e7dac69f8e3f90620729ee730327a3e168963d"

