FROM openshift/golang-builder:1.11 AS builder
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=27 OS_GIT_VERSION=4.2.27-202003301126-4457e00 OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=4457e00c7d73c6dc9f2fa98ae31959c921fc2db8 SOURCE_GIT_TAG=openshift-enterprise-cluster-capacity-3.10.80-1-2-g4457e00c7 SOURCE_GIT_URL=https://github.com/openshift/cluster-capacity SOURCE_DATE_EPOCH=1554127020 OS_GIT_COMMIT=4457e00 BUILD_VERSION=v4.2.27 BUILD_RELEASE=202003301126
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.2.27.20200330.112641
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=27 OS_GIT_VERSION=4.2.27-202003301126-4457e00 OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=4457e00c7d73c6dc9f2fa98ae31959c921fc2db8 SOURCE_GIT_TAG=openshift-enterprise-cluster-capacity-3.10.80-1-2-g4457e00c7 SOURCE_GIT_URL=https://github.com/openshift/cluster-capacity SOURCE_DATE_EPOCH=1554127020 OS_GIT_COMMIT=4457e00 BUILD_VERSION=v4.2.27 BUILD_RELEASE=202003301126
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" \
        version="v4.2.27" \
        release="202003301126" \
        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"

