# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM openshift/golang-builder:1.13 AS builder
ENV __doozer=update BUILD_RELEASE=202103150243.p0 BUILD_VERSION=v4.5.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=5 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.5.0-202103150243.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=85701ab OS_GIT_VERSION=4.5.0-202103150243.p0-85701ab SOURCE_DATE_EPOCH=1600339473 SOURCE_GIT_COMMIT=85701abcd927e9dee827d1f86e549ce6faa41c7f SOURCE_GIT_TAG=v0.1-54-g85701ab SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-ovirt 

ARG version 
ARG release 

LABEL   com.redhat.component="machine-api" \
        name="cluster-api-provider-ovirt" \
        version="$version" \
        release="$release" \
        architecture="x86_64" \
        summary="cluster-api-provider-ovirt" \
        maintainer="Roy Golan <rgolan@redhat.com>"

WORKDIR /go/cluster-api-provider-ovirt
COPY . .


RUN git --version 
RUN make build

FROM openshift/ose-base:v4.5.0.20210315.031146
ENV __doozer=update BUILD_RELEASE=202103150243.p0 BUILD_VERSION=v4.5.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=5 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.5.0-202103150243.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=85701ab OS_GIT_VERSION=4.5.0-202103150243.p0-85701ab SOURCE_DATE_EPOCH=1600339473 SOURCE_GIT_COMMIT=85701abcd927e9dee827d1f86e549ce6faa41c7f SOURCE_GIT_TAG=v0.1-54-g85701ab SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-ovirt 

COPY --from=builder /go/cluster-api-provider-ovirt/bin/manager /
COPY --from=builder /go/cluster-api-provider-ovirt/bin/machine-controller-manager /

LABEL \
        name="openshift/ose-ovirt-machine-controllers" \
        com.redhat.component="ose-ovirt-machine-controllers-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Cloud Compute" \
        io.openshift.maintainer.subcomponent="oVirt Provider" \
        release="202103150243.p0" \
        io.openshift.build.commit.id="85701abcd927e9dee827d1f86e549ce6faa41c7f" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-api-provider-ovirt" \
        io.openshift.build.commit.url="https://github.com/openshift/cluster-api-provider-ovirt/commit/85701abcd927e9dee827d1f86e549ce6faa41c7f" \
        version="v4.5.0"

