FROM openshift/golang-builder:1.13 AS builder
ENV __doozer=update BUILD_RELEASE=202006080610 BUILD_VERSION=v4.4.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=4 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.4.0-202006080610 
ENV __doozer=merge OS_GIT_COMMIT=fceb1f8 OS_GIT_VERSION=4.4.0-202006080610-fceb1f8 SOURCE_DATE_EPOCH=1583420572 SOURCE_GIT_COMMIT=fceb1f8b50c284e3831192a431d71e4a9bd50505 SOURCE_GIT_TAG=fceb1f8b SOURCE_GIT_URL=https://github.com/openshift/cluster-capacity 
WORKDIR /go/src/github.com/kubernetes-incubator/cluster-capacity
COPY . .
RUN go build -o hypercc ./cmd/hypercc

FROM openshift/ose-base:v4.4.0.20200608.061016
ENV __doozer=update BUILD_RELEASE=202006080610 BUILD_VERSION=v4.4.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=4 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.4.0-202006080610 
ENV __doozer=merge OS_GIT_COMMIT=fceb1f8 OS_GIT_VERSION=4.4.0-202006080610-fceb1f8 SOURCE_DATE_EPOCH=1583420572 SOURCE_GIT_COMMIT=fceb1f8b50c284e3831192a431d71e4a9bd50505 SOURCE_GIT_TAG=fceb1f8b SOURCE_GIT_URL=https://github.com/openshift/cluster-capacity 
COPY --from=builder /go/src/github.com/kubernetes-incubator/cluster-capacity/hypercc /usr/bin/
RUN ln -sf /usr/bin/hypercc /usr/bin/cluster-capacity
RUN ln -sf /usr/bin/hypercc /usr/bin/genpod
CMD ["/usr/bin/cluster-capacity", "--help"]

LABEL \
        License="GPLv2+" \
        io.k8s.description="This is a component of OpenShift Container Platform and runs Cluster Capacity analysis tool." \
        io.k8s.display-name="OpenShift Container Platform Cluster Capacity" \
        io.openshift.tags="openshift,cluster-capacity" \
        vendor="Red Hat" \
        name="openshift/ose-cluster-capacity" \
        com.redhat.component="openshift-enterprise-cluster-capacity-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="kube-scheduler" \
        version="v4.4.0" \
        release="202006080610" \
        io.openshift.build.commit.id="fceb1f8b50c284e3831192a431d71e4a9bd50505" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-capacity" \
        io.openshift.build.commit.url="https://github.com/openshift/cluster-capacity/commit/fceb1f8b50c284e3831192a431d71e4a9bd50505"

