FROM openshift/golang-builder:rhel_8_golang_1.15 AS builder
ENV __doozer=update BUILD_RELEASE=202103010126.p0 BUILD_VERSION=v4.6.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=6 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.6.0-202103010126.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=1ca52ad OS_GIT_VERSION=4.6.0-202103010126.p0-1ca52ad SOURCE_DATE_EPOCH=1600506110 SOURCE_GIT_COMMIT=1ca52adab176154cbdd27e150fc67e2513acc84b SOURCE_GIT_TAG=v0.2.0-139-g1ca52ada SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-libvirt 
RUN yum install -y libvirt-devel

WORKDIR /go/src/github.com/openshift/cluster-api-provider-libvirt
COPY . .
RUN go build -o machine-controller-manager ./cmd/manager

FROM openshift/ose-base:v4.6.0.20210301.020451
ENV __doozer=update BUILD_RELEASE=202103010126.p0 BUILD_VERSION=v4.6.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=6 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.6.0-202103010126.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=1ca52ad OS_GIT_VERSION=4.6.0-202103010126.p0-1ca52ad SOURCE_DATE_EPOCH=1600506110 SOURCE_GIT_COMMIT=1ca52adab176154cbdd27e150fc67e2513acc84b SOURCE_GIT_TAG=v0.2.0-139-g1ca52ada SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-libvirt 
RUN INSTALL_PKGS=" \
      libvirt-libs openssh-clients genisoimage \
      " && \
    yum install -y $INSTALL_PKGS && \
    rpm -V $INSTALL_PKGS && \
    yum clean all
COPY --from=builder /go/src/github.com/openshift/cluster-api-provider-libvirt/machine-controller-manager /

LABEL \
        name="openshift/ose-libvirt-machine-controllers" \
        com.redhat.component="ose-libvirt-machine-controllers-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        release="202103010126.p0" \
        io.openshift.build.commit.id="1ca52adab176154cbdd27e150fc67e2513acc84b" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-api-provider-libvirt" \
        io.openshift.build.commit.url="https://github.com/openshift/cluster-api-provider-libvirt/commit/1ca52adab176154cbdd27e150fc67e2513acc84b" \
        version="v4.6.0"

