FROM openshift/golang-builder:1.12 AS builder
ENV __doozer=update BUILD_RELEASE=202005250821 BUILD_VERSION=v4.3.23 OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=23 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.3.23-202005250821 
ENV __doozer=merge OS_GIT_COMMIT=4457e00 OS_GIT_VERSION=4.3.23-202005250821-4457e00 SOURCE_DATE_EPOCH=1554127020 SOURCE_GIT_COMMIT=4457e00c7d73c6dc9f2fa98ae31959c921fc2db8 SOURCE_GIT_TAG=4457e00c7 SOURCE_GIT_URL=https://github.com/openshift/cluster-capacity 
WORKDIR /go/src/github.com/kubernetes-incubator/cluster-capacity
COPY . .
RUN make build; \
    mkdir -p /tmp/build; \
    cp /go/src/github.com/kubernetes-incubator/cluster-capacity/_output/local/bin/linux/$(go env GOARCH)/hypercc /tmp/build/hypercc

FROM openshift/ose-base:v4.3.23.20200525.082129
ENV __doozer=update BUILD_RELEASE=202005250821 BUILD_VERSION=v4.3.23 OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=23 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.3.23-202005250821 
ENV __doozer=merge OS_GIT_COMMIT=4457e00 OS_GIT_VERSION=4.3.23-202005250821-4457e00 SOURCE_DATE_EPOCH=1554127020 SOURCE_GIT_COMMIT=4457e00c7d73c6dc9f2fa98ae31959c921fc2db8 SOURCE_GIT_TAG=4457e00c7 SOURCE_GIT_URL=https://github.com/openshift/cluster-capacity 
COPY --from=builder /tmp/build/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.3.23" \
        release="202005250821" \
        io.openshift.build.commit.id="4457e00c7d73c6dc9f2fa98ae31959c921fc2db8" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-capacity" \
        io.openshift.build.commit.url="https://github.com/openshift/cluster-capacity/commit/4457e00c7d73c6dc9f2fa98ae31959c921fc2db8"

