FROM openshift/golang-builder:1.13 AS builder
ENV __doozer=update BUILD_RELEASE=202005252114 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-202005252114 
ENV __doozer=merge OS_GIT_COMMIT=2937f80 OS_GIT_VERSION=4.4.0-202005252114-2937f80 SOURCE_DATE_EPOCH=1581065152 SOURCE_GIT_COMMIT=2937f802e2ee0602ec293d4bacfac21725a021c9 SOURCE_GIT_TAG=2937f802 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/cluster-api/cmd/manager

FROM openshift/ose-base:v4.4.0.20200525.211442
ENV __doozer=update BUILD_RELEASE=202005252114 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-202005252114 
ENV __doozer=merge OS_GIT_COMMIT=2937f80 OS_GIT_VERSION=4.4.0-202005252114-2937f80 SOURCE_DATE_EPOCH=1581065152 SOURCE_GIT_COMMIT=2937f802e2ee0602ec293d4bacfac21725a021c9 SOURCE_GIT_TAG=2937f802 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" \
        version="v4.4.0" \
        release="202005252114" \
        io.openshift.build.commit.id="2937f802e2ee0602ec293d4bacfac21725a021c9" \
        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/2937f802e2ee0602ec293d4bacfac21725a021c9"

