FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.17-openshift-4.10 AS builder

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 registry.ci.openshift.org/ocp/4.10:base

COPY --from=builder /usr/bin/adapter /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>"

USER 1001

ENTRYPOINT ["/usr/bin/adapter"]
