FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=52a3e249a7053149b08374fd989fd5543d3bdcbd SOURCE_DATE_EPOCH=1569506600 BUILD_VERSION=v4.2.0 SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-openstack SOURCE_GIT_TAG=52a3e249 BUILD_RELEASE=201910101614
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.2.0.20191010.161456
ENV SOURCE_GIT_COMMIT=52a3e249a7053149b08374fd989fd5543d3bdcbd SOURCE_DATE_EPOCH=1569506600 BUILD_VERSION=v4.2.0 SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-openstack SOURCE_GIT_TAG=52a3e249 BUILD_RELEASE=201910101614
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 \
        com.redhat.component="ose-openstack-machine-controllers-container" \
        io.openshift.build.commit.url="https://github.com/openshift/cluster-api-provider-openstack/commit/52a3e249a7053149b08374fd989fd5543d3bdcbd" \
        version="v4.2.0" \
        name="openshift/ose-openstack-machine-controllers" \
        io.openshift.build.commit.id="52a3e249a7053149b08374fd989fd5543d3bdcbd" \
        release="201910101614" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-api-provider-openstack"

