FROM openshift/golang-builder:1.12 AS builder
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=7 OS_GIT_VERSION=4.3.7-202003161611-dd3fc51 OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=dd3fc51a8b7f51da61643a6286eb0fecfa2d03cd SOURCE_GIT_TAG=v0.2.0-107-gdd3fc51a SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-libvirt SOURCE_DATE_EPOCH=1576180729 OS_GIT_COMMIT=dd3fc51 BUILD_VERSION=v4.3.7 BUILD_RELEASE=202003161611
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.7.20200316.161155
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=7 OS_GIT_VERSION=4.3.7-202003161611-dd3fc51 OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=dd3fc51a8b7f51da61643a6286eb0fecfa2d03cd SOURCE_GIT_TAG=v0.2.0-107-gdd3fc51a SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-libvirt SOURCE_DATE_EPOCH=1576180729 OS_GIT_COMMIT=dd3fc51 BUILD_VERSION=v4.3.7 BUILD_RELEASE=202003161611
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" \
        version="v4.3.7" \
        release="202003161611" \
        io.openshift.build.commit.id="dd3fc51a8b7f51da61643a6286eb0fecfa2d03cd" \
        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/dd3fc51a8b7f51da61643a6286eb0fecfa2d03cd"

