FROM openshift/golang-builder@sha256:21aab8ec0f5d119e4f6dab12f7ad6a1cec15d5f9071ae0c7431be760f29d4c71 AS builder
ENV __doozer=update BUILD_RELEASE=202202120107.p0.g59ae2ed.assembly.stream BUILD_VERSION=v4.9.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=9 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.9.0-202202120107.p0.g59ae2ed.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=59ae2ed OS_GIT_VERSION=4.9.0-202202120107.p0.g59ae2ed.assembly.stream-59ae2ed SOURCE_DATE_EPOCH=1624489665 SOURCE_GIT_COMMIT=59ae2edf88755f915b7d76d78a8934ee17487ad6 SOURCE_GIT_TAG=v0.2.0-151-g59ae2edf 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.9.0-202201261125.p0.gf93eca8.assembly.stream
ENV __doozer=update BUILD_RELEASE=202202120107.p0.g59ae2ed.assembly.stream BUILD_VERSION=v4.9.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=9 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.9.0-202202120107.p0.g59ae2ed.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=59ae2ed OS_GIT_VERSION=4.9.0-202202120107.p0.g59ae2ed.assembly.stream-59ae2ed SOURCE_DATE_EPOCH=1624489665 SOURCE_GIT_COMMIT=59ae2edf88755f915b7d76d78a8934ee17487ad6 SOURCE_GIT_TAG=v0.2.0-151-g59ae2edf 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="202202120107.p0.g59ae2ed.assembly.stream" \
        io.openshift.build.commit.id="59ae2edf88755f915b7d76d78a8934ee17487ad6" \
        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/59ae2edf88755f915b7d76d78a8934ee17487ad6" \
        version="v4.9.0"

