FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=79d3a265492b1658d57ca6ff1f610ebd7efc59cf SOURCE_DATE_EPOCH=1576189616 BUILD_VERSION=v4.2.14 SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-libvirt SOURCE_GIT_TAG=v0.2.0-101-g79d3a265 BUILD_RELEASE=202001061701
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.2.14.20200106.170123
ENV SOURCE_GIT_COMMIT=79d3a265492b1658d57ca6ff1f610ebd7efc59cf SOURCE_DATE_EPOCH=1576189616 BUILD_VERSION=v4.2.14 SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-libvirt SOURCE_GIT_TAG=v0.2.0-101-g79d3a265 BUILD_RELEASE=202001061701
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 \
        com.redhat.component="ose-libvirt-machine-controllers-container" \
        io.openshift.build.commit.url="https://github.com/openshift/cluster-api-provider-libvirt/commit/79d3a265492b1658d57ca6ff1f610ebd7efc59cf" \
        version="v4.2.14" \
        name="openshift/ose-libvirt-machine-controllers" \
        io.openshift.build.commit.id="79d3a265492b1658d57ca6ff1f610ebd7efc59cf" \
        release="202001061701" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-api-provider-libvirt"

