FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.15-openshift-4.7 AS builder
WORKDIR /go/src/sigs.k8s.io/cluster-capacity
COPY . .
RUN go build -o hypercc ./cmd/hypercc

FROM registry.ci.openshift.org/ocp/4.7:base
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"]
