FROM openshift/golang-builder:1.12 AS builder
ENV __doozer=update BUILD_RELEASE=202005250821 BUILD_VERSION=v4.3.23 OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=23 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.3.23-202005250821 
ENV __doozer=merge OS_GIT_COMMIT=7aa99e2 OS_GIT_VERSION=4.3.23-202005250821-7aa99e2 SOURCE_DATE_EPOCH=1580848160 SOURCE_GIT_COMMIT=7aa99e291276aa2f26260f8e654078ab6c2464f0 SOURCE_GIT_TAG=7aa99e29 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.3.23.20200525.082129
ENV __doozer=update BUILD_RELEASE=202005250821 BUILD_VERSION=v4.3.23 OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=23 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.3.23-202005250821 
ENV __doozer=merge OS_GIT_COMMIT=7aa99e2 OS_GIT_VERSION=4.3.23-202005250821-7aa99e2 SOURCE_DATE_EPOCH=1580848160 SOURCE_GIT_COMMIT=7aa99e291276aa2f26260f8e654078ab6c2464f0 SOURCE_GIT_TAG=7aa99e29 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.3.23" \
        release="202005250821" \
        io.openshift.build.commit.id="7aa99e291276aa2f26260f8e654078ab6c2464f0" \
        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/7aa99e291276aa2f26260f8e654078ab6c2464f0"

