FROM openshift/golang-builder:rhel_8_golang_1.15 AS builder
ENV __doozer=update BUILD_RELEASE=202105210313.p0 BUILD_VERSION=v4.6.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=6 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.6.0-202105210313.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=48b7341 OS_GIT_VERSION=4.6.0-202105210313.p0-48b7341 SOURCE_DATE_EPOCH=1616092513 SOURCE_GIT_COMMIT=48b73415908af2333641faef06fb104666120177 SOURCE_GIT_TAG=48b73415 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

FROM openshift/ose-base:v4.6.0-202105191948.p0
ENV __doozer=update BUILD_RELEASE=202105210313.p0 BUILD_VERSION=v4.6.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=6 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.6.0-202105210313.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=48b7341 OS_GIT_VERSION=4.6.0-202105210313.p0-48b7341 SOURCE_DATE_EPOCH=1616092513 SOURCE_GIT_COMMIT=48b73415908af2333641faef06fb104666120177 SOURCE_GIT_TAG=48b73415 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/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="Cloud Compute" \
        io.openshift.maintainer.subcomponent="OpenStack Provider" \
        release="202105210313.p0" \
        io.openshift.build.commit.id="48b73415908af2333641faef06fb104666120177" \
        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/48b73415908af2333641faef06fb104666120177" \
        version="v4.6.0"

