FROM openshift/golang-builder:1.13 AS builder
ENV __doozer=update BUILD_RELEASE=202007060343.p0 BUILD_VERSION=v4.4.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=4 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.4.0-202007060343.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=d8dc8cd OS_GIT_VERSION=4.4.0-202007060343.p0-d8dc8cd SOURCE_DATE_EPOCH=1593779379 SOURCE_GIT_COMMIT=d8dc8cd314d7a07a1d0d643e31f1aa07c1790f28 SOURCE_GIT_TAG=d8dc8cd3 SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-openstack 
WORKDIR /go/src/sigs.k8s.io/cluster-api-provider-openstack
COPY . .

RUN go build -o ./machine-controller-manager ./cmd/manager
RUN go build -o ./manager ./vendor/github.com/openshift/machine-api-operator/cmd/machineset

FROM openshift/ose-base:v4.4.0.20200706.034325
ENV __doozer=update BUILD_RELEASE=202007060343.p0 BUILD_VERSION=v4.4.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=4 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.4.0-202007060343.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=d8dc8cd OS_GIT_VERSION=4.4.0-202007060343.p0-d8dc8cd SOURCE_DATE_EPOCH=1593779379 SOURCE_GIT_COMMIT=d8dc8cd314d7a07a1d0d643e31f1aa07c1790f28 SOURCE_GIT_TAG=d8dc8cd3 SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-openstack 
RUN INSTALL_PKGS=" \
      openssh \
      " && \
    yum install -y $INSTALL_PKGS && \
    rpm -V $INSTALL_PKGS && \
    yum clean all
COPY --from=builder /go/src/sigs.k8s.io/cluster-api-provider-openstack/manager /
COPY --from=builder /go/src/sigs.k8s.io/cluster-api-provider-openstack/machine-controller-manager /

LABEL \
        name="openshift/ose-openstack-machine-controllers" \
        com.redhat.component="ose-openstack-machine-controllers-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Installer" \
        io.openshift.maintainer.subcomponent="OpenShift on OpenStack" \
        release="202007060343.p0" \
        io.openshift.build.commit.id="d8dc8cd314d7a07a1d0d643e31f1aa07c1790f28" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-api-provider-openstack" \
        io.openshift.build.commit.url="https://github.com/openshift/cluster-api-provider-openstack/commit/d8dc8cd314d7a07a1d0d643e31f1aa07c1790f28" \
        version="v4.4.0"

