FROM openshift/golang-builder:rhel_8_golang_1.15 AS builder
ENV __doozer=update BUILD_RELEASE=202103010125.p0 BUILD_VERSION=v4.7.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=7 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.7.0-202103010125.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=7f1d0ad OS_GIT_VERSION=4.7.0-202103010125.p0-7f1d0ad SOURCE_DATE_EPOCH=1610113499 SOURCE_GIT_COMMIT=7f1d0ad0b53d17879034597d97dac23c9a23dbcb SOURCE_GIT_TAG=atomic-openshift-cluster-autoscaler-4.0.0-0.147.0-3428-g7f1d0ad0b SOURCE_GIT_URL=https://github.com/openshift/kubernetes-autoscaler 
WORKDIR /go/src/k8s.io/autoscaler/vertical-pod-autoscaler
COPY . .
RUN go build ./pkg/admission-controller
RUN go build ./pkg/updater
RUN go build ./pkg/recommender

FROM openshift/ose-base:v4.7.0.20210301.020426
ENV __doozer=update BUILD_RELEASE=202103010125.p0 BUILD_VERSION=v4.7.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=7 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.7.0-202103010125.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=7f1d0ad OS_GIT_VERSION=4.7.0-202103010125.p0-7f1d0ad SOURCE_DATE_EPOCH=1610113499 SOURCE_GIT_COMMIT=7f1d0ad0b53d17879034597d97dac23c9a23dbcb SOURCE_GIT_TAG=atomic-openshift-cluster-autoscaler-4.0.0-0.147.0-3428-g7f1d0ad0b SOURCE_GIT_URL=https://github.com/openshift/kubernetes-autoscaler 
COPY --from=builder \
    /go/src/k8s.io/autoscaler/vertical-pod-autoscaler/admission-controller \
    /go/src/k8s.io/autoscaler/vertical-pod-autoscaler/updater \
    /go/src/k8s.io/autoscaler/vertical-pod-autoscaler/recommender \
    /usr/bin/

LABEL \
        summary="Vertical Pod Autoscaler for OpenShift and Kubernetes" \
        name="openshift/ose-vertical-pod-autoscaler-rhel8" \
        com.redhat.component="ose-vertical-pod-autoscaler-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Node" \
        io.openshift.maintainer.subcomponent="Cluster Autoscaler" \
        release="202103010125.p0" \
        io.openshift.build.commit.id="7f1d0ad0b53d17879034597d97dac23c9a23dbcb" \
        io.openshift.build.source-location="https://github.com/openshift/kubernetes-autoscaler" \
        io.openshift.build.commit.url="https://github.com/openshift/kubernetes-autoscaler/commit/7f1d0ad0b53d17879034597d97dac23c9a23dbcb" \
        version="v4.7.0"

