FROM openshift/golang-builder:1.12 AS builder
ENV __doozer=update BUILD_RELEASE=202008311640.p0 BUILD_VERSION=v4.3.35 OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=35 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.3.35-202008311640.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=27c6396 OS_GIT_VERSION=4.3.35-202008311640.p0-27c6396 SOURCE_DATE_EPOCH=1595613567 SOURCE_GIT_COMMIT=27c6396760b749b063726186dd14b1e0ea0f00bc SOURCE_GIT_TAG=v0.2.0-113-g27c63967 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
RUN go build -o manager ./vendor/github.com/openshift/cluster-api/cmd/manager

FROM openshift/ose-base:v4.3.35.20200831.164005
ENV __doozer=update BUILD_RELEASE=202008311640.p0 BUILD_VERSION=v4.3.35 OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=35 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.3.35-202008311640.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=27c6396 OS_GIT_VERSION=4.3.35-202008311640.p0-27c6396 SOURCE_DATE_EPOCH=1595613567 SOURCE_GIT_COMMIT=27c6396760b749b063726186dd14b1e0ea0f00bc SOURCE_GIT_TAG=v0.2.0-113-g27c63967 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/manager /
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="202008311640.p0" \
        io.openshift.build.commit.id="27c6396760b749b063726186dd14b1e0ea0f00bc" \
        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/27c6396760b749b063726186dd14b1e0ea0f00bc" \
        version="v4.3.35"

