FROM openshift/golang-builder:rhel_8_golang_1.15 AS builder
ENV __doozer=update BUILD_RELEASE=202103130041.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-202103130041.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=b57e18b OS_GIT_VERSION=4.7.0-202103130041.p0-b57e18b SOURCE_DATE_EPOCH=1607017590 SOURCE_GIT_COMMIT=b57e18b197838f6d6c377cca00fd47f9af645f3f SOURCE_GIT_TAG=v0.2.0-143-gb57e18b1 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.7.0.20210313.011210
ENV __doozer=update BUILD_RELEASE=202103130041.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-202103130041.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=b57e18b OS_GIT_VERSION=4.7.0-202103130041.p0-b57e18b SOURCE_DATE_EPOCH=1607017590 SOURCE_GIT_COMMIT=b57e18b197838f6d6c377cca00fd47f9af645f3f SOURCE_GIT_TAG=v0.2.0-143-gb57e18b1 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="202103130041.p0" \
        io.openshift.build.commit.id="b57e18b197838f6d6c377cca00fd47f9af645f3f" \
        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/b57e18b197838f6d6c377cca00fd47f9af645f3f" \
        version="v4.7.0"

