FROM openshift/golang-builder:rhel_8_golang_1.16 AS builder
ENV __doozer=update BUILD_RELEASE=202111041612.p0.git.b5d39fd.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-202111041612.p0.git.b5d39fd.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=b5d39fd OS_GIT_VERSION=4.9.0-202111041612.p0.git.b5d39fd.assembly.stream-b5d39fd SOURCE_DATE_EPOCH=1628495469 SOURCE_GIT_COMMIT=b5d39fd5758f4953ecf69b8811d4939b504f242a SOURCE_GIT_TAG=openshift-enterprise-cluster-capacity-3.10.80-1-127-gb5d39fd57 SOURCE_GIT_URL=https://github.com/openshift/cluster-capacity 
WORKDIR /go/src/sigs.k8s.io/cluster-capacity
COPY . .
RUN GO111MODULE=auto go build -o hypercc ./cmd/hypercc

FROM openshift/ose-base:v4.9.0.20211104.162029
ENV __doozer=update BUILD_RELEASE=202111041612.p0.git.b5d39fd.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-202111041612.p0.git.b5d39fd.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=b5d39fd OS_GIT_VERSION=4.9.0-202111041612.p0.git.b5d39fd.assembly.stream-b5d39fd SOURCE_DATE_EPOCH=1628495469 SOURCE_GIT_COMMIT=b5d39fd5758f4953ecf69b8811d4939b504f242a SOURCE_GIT_TAG=openshift-enterprise-cluster-capacity-3.10.80-1-127-gb5d39fd57 SOURCE_GIT_URL=https://github.com/openshift/cluster-capacity 
COPY --from=builder /go/src/sigs.k8s.io/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" \
        summary="Framework that estimates a number of instances of a specified pod that would be scheduled in a cluster" \
        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" \
        release="202111041612.p0.git.b5d39fd.assembly.stream" \
        io.openshift.build.commit.id="b5d39fd5758f4953ecf69b8811d4939b504f242a" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-capacity" \
        io.openshift.build.commit.url="https://github.com/openshift/cluster-capacity/commit/b5d39fd5758f4953ecf69b8811d4939b504f242a" \
        version="v4.9.0"

