# Copyright 2019 The Kubernetes Authors.
#
# 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@sha256:21aab8ec0f5d119e4f6dab12f7ad6a1cec15d5f9071ae0c7431be760f29d4c71 AS builder
ENV __doozer=update BUILD_RELEASE=202202120107.p0.g3bf2b7f.assembly.stream BUILD_VERSION=v4.9.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=9 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.9.0-202202120107.p0.g3bf2b7f.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=3bf2b7f OS_GIT_VERSION=4.9.0-202202120107.p0.g3bf2b7f.assembly.stream-3bf2b7f SOURCE_DATE_EPOCH=1644197787 SOURCE_GIT_COMMIT=3bf2b7ff289814b198feb0a56cb85967db18e9dc SOURCE_GIT_TAG=v0.1.0-alpha.3-234-g3bf2b7ff SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-azure 
WORKDIR /go/src/sigs.k8s.io/cluster-api-provider-azure
COPY . .
# VERSION env gets set in the openshift/release image and refers to the golang version, which interferes with our own
RUN unset VERSION \
  && GOPROXY=off NO_DOCKER=1 make build

FROM openshift/ose-base:v4.9.0-202201261125.p0.gf93eca8.assembly.stream
ENV __doozer=update BUILD_RELEASE=202202120107.p0.g3bf2b7f.assembly.stream BUILD_VERSION=v4.9.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=9 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.9.0-202202120107.p0.g3bf2b7f.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=3bf2b7f OS_GIT_VERSION=4.9.0-202202120107.p0.g3bf2b7f.assembly.stream-3bf2b7f SOURCE_DATE_EPOCH=1644197787 SOURCE_GIT_COMMIT=3bf2b7ff289814b198feb0a56cb85967db18e9dc SOURCE_GIT_TAG=v0.1.0-alpha.3-234-g3bf2b7ff SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-azure 
COPY --from=builder /go/src/sigs.k8s.io/cluster-api-provider-azure/bin/machine-controller-manager /
COPY --from=builder /go/src/sigs.k8s.io/cluster-api-provider-azure/bin/termination-handler /

LABEL \
        name="openshift/ose-azure-machine-controllers" \
        com.redhat.component="ose-azure-machine-controllers-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Cloud Compute" \
        io.openshift.maintainer.subcomponent="Other Providers" \
        release="202202120107.p0.g3bf2b7f.assembly.stream" \
        io.openshift.build.commit.id="3bf2b7ff289814b198feb0a56cb85967db18e9dc" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-api-provider-azure" \
        io.openshift.build.commit.url="https://github.com/openshift/cluster-api-provider-azure/commit/3bf2b7ff289814b198feb0a56cb85967db18e9dc" \
        version="v4.9.0"

