FROM openshift/golang-builder:1.12 AS builder
ENV 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 BUILD_VERSION=v4.3.1 BUILD_RELEASE=202002032140
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.1.20200203.214022
ENV 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 BUILD_VERSION=v4.3.1 BUILD_RELEASE=202002032140
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.1" \
        release="202002032140" \
        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"

