FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=c44b83dacbdd3dc6bc051c96a1b0d6f6865c685b SOURCE_GIT_TAG=atomic-openshift-cluster-autoscaler-4.0.0-0.139.0-210-gc44b83da SOURCE_GIT_URL=https://github.com/openshift/kubernetes-autoscaler SOURCE_DATE_EPOCH=1567789077 BUILD_VERSION=v4.2.19 BUILD_RELEASE=202002101212
WORKDIR /go/src/k8s.io/autoscaler
COPY . .
RUN go build -o cluster-autoscaler/cluster-autoscaler ./cluster-autoscaler

FROM openshift/ose-base:ubi7
ENV SOURCE_GIT_COMMIT=c44b83dacbdd3dc6bc051c96a1b0d6f6865c685b SOURCE_GIT_TAG=atomic-openshift-cluster-autoscaler-4.0.0-0.139.0-210-gc44b83da SOURCE_GIT_URL=https://github.com/openshift/kubernetes-autoscaler SOURCE_DATE_EPOCH=1567789077 BUILD_VERSION=v4.2.19 BUILD_RELEASE=202002101212
COPY --from=builder /go/src/k8s.io/autoscaler/cluster-autoscaler/cluster-autoscaler /usr/bin/
CMD /usr/bin/cluster-autoscaler

LABEL \
        summary="Cluster Autoscaler for OpenShift and Kubernetes" \
        License="ASL 2.0" \
        io.k8s.description="Cluster Autoscaler for OpenShift and Kubernetes." \
        io.k8s.display-name="OpenShift Container Platform Cluster Autoscaler" \
        io.openshift.tags="openshift,autoscaler" \
        vendor="Red Hat" \
        name="openshift/ose-cluster-autoscaler" \
        com.redhat.component="atomic-openshift-cluster-autoscaler-container" \
        version="v4.2.19" \
        release="202002101212" \
        io.openshift.build.commit.id="c44b83dacbdd3dc6bc051c96a1b0d6f6865c685b" \
        io.openshift.build.source-location="https://github.com/openshift/kubernetes-autoscaler" \
        io.openshift.build.commit.url="https://github.com/openshift/kubernetes-autoscaler/commit/c44b83dacbdd3dc6bc051c96a1b0d6f6865c685b"

