FROM openshift/golang-builder:rhel_8_golang_1.16 AS builder
ENV __doozer=update BUILD_RELEASE=202111020858.p0.git.adfdd41.assembly.stream BUILD_VERSION=v4.9.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=9 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.9.0-202111020858.p0.git.adfdd41.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=adfdd41 OS_GIT_VERSION=4.9.0-202111020858.p0.git.adfdd41.assembly.stream-adfdd41 SOURCE_DATE_EPOCH=1629357114 SOURCE_GIT_COMMIT=adfdd41d3fba23d38645c1c655687c28e27979df SOURCE_GIT_TAG=v0.2.0-403-gadfdd41d SOURCE_GIT_URL=https://github.com/openshift/k8s-prometheus-adapter 

COPY . /go/src/github.com/kubernetes-sigs/prometheus-adapter

WORKDIR /go/src/github.com/kubernetes-sigs/prometheus-adapter
RUN make
RUN mv /go/src/github.com/kubernetes-sigs/prometheus-adapter/adapter /usr/bin/adapter

FROM openshift/ose-base:v4.9.0.20211102.090836
ENV __doozer=update BUILD_RELEASE=202111020858.p0.git.adfdd41.assembly.stream BUILD_VERSION=v4.9.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=9 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.9.0-202111020858.p0.git.adfdd41.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=adfdd41 OS_GIT_VERSION=4.9.0-202111020858.p0.git.adfdd41.assembly.stream-adfdd41 SOURCE_DATE_EPOCH=1629357114 SOURCE_GIT_COMMIT=adfdd41d3fba23d38645c1c655687c28e27979df SOURCE_GIT_TAG=v0.2.0-403-gadfdd41d SOURCE_GIT_URL=https://github.com/openshift/k8s-prometheus-adapter 

COPY --from=builder /usr/bin/adapter /usr/bin/adapter
    

USER 1001

ENTRYPOINT ["/usr/bin/adapter"]

LABEL \
        io.k8s.display-name="OpenShift Prometheus Adapter" \
        io.k8s.description="This is a component of OpenShift Container Platform that provides the Kubernetes resource metrics API based on Prometheus metrics" \
        io.openshift.tags="openshift" \
        summary="This is a component of OpenShift Container Platform that provides the Kubernetes resource metrics API based on Prometheus metrics" \
        maintainer="OpenShift Monitoring Team <team-monitoring@redhat.com>" \
        name="openshift/ose-k8s-prometheus-adapter" \
        com.redhat.component="ose-prometheus-adapter-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Monitoring" \
        release="202111020858.p0.git.adfdd41.assembly.stream" \
        io.openshift.build.commit.id="adfdd41d3fba23d38645c1c655687c28e27979df" \
        io.openshift.build.source-location="https://github.com/openshift/k8s-prometheus-adapter" \
        io.openshift.build.commit.url="https://github.com/openshift/k8s-prometheus-adapter/commit/adfdd41d3fba23d38645c1c655687c28e27979df" \
        version="v4.9.0"

