FROM openshift/golang-builder:rhel_8_golang_1.16 AS builder
ENV __doozer=update BUILD_RELEASE=202106291913.p0.git.1a48d4b.assembly.stream BUILD_VERSION=v4.8.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=8 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.8.0-202106291913.p0.git.1a48d4b.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=1a48d4b OS_GIT_VERSION=4.8.0-202106291913.p0.git.1a48d4b.assembly.stream-1a48d4b SOURCE_DATE_EPOCH=1615543590 SOURCE_GIT_COMMIT=1a48d4b99ab5a2ce89fa909d12f3256f7489544f SOURCE_GIT_TAG=v0.2.0-146-g1a48d4b9 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.8.0-202106152230.p0.git.ad38e11.assembly.stream
ENV __doozer=update BUILD_RELEASE=202106291913.p0.git.1a48d4b.assembly.stream BUILD_VERSION=v4.8.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=8 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.8.0-202106291913.p0.git.1a48d4b.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=1a48d4b OS_GIT_VERSION=4.8.0-202106291913.p0.git.1a48d4b.assembly.stream-1a48d4b SOURCE_DATE_EPOCH=1615543590 SOURCE_GIT_COMMIT=1a48d4b99ab5a2ce89fa909d12f3256f7489544f SOURCE_GIT_TAG=v0.2.0-146-g1a48d4b9 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="202106291913.p0.git.1a48d4b.assembly.stream" \
        io.openshift.build.commit.id="1a48d4b99ab5a2ce89fa909d12f3256f7489544f" \
        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/1a48d4b99ab5a2ce89fa909d12f3256f7489544f" \
        version="v4.8.0"

