FROM openshift/golang-builder:rhel_8_golang_1.15 AS build
ENV __doozer=update BUILD_RELEASE=202107291702.p0.git.cc06fc6 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-202107291702.p0.git.cc06fc6 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=cc06fc6 OS_GIT_VERSION=4.6.0-202107291702.p0.git.cc06fc6-cc06fc6 SOURCE_DATE_EPOCH=1613066017 SOURCE_GIT_COMMIT=cc06fc6ba3ffef27180f9c6ca21fb1e129727ded SOURCE_GIT_TAG=v2.8.2-33-gcc06fc6ba SOURCE_GIT_URL=https://github.com/kube-reporting/helm 

RUN yum install --setopt=skip_missing_names_on_install=False -y \
        hg git make \
    && yum clean all \
    && rm -rf /var/cache/yum

ENV GOPATH /go

RUN mkdir -p /go/src/k8s.io/helm
WORKDIR /go/src/k8s.io/helm
COPY . .

# unset VERSION inherited from base before building
ENV VERSION ""
RUN make build
RUN make docker-binary

FROM openshift/base-rhel8:v4.6.0-202107281959.p0.git.f17f552
ENV __doozer=update BUILD_RELEASE=202107291702.p0.git.cc06fc6 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-202107291702.p0.git.cc06fc6 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=cc06fc6 OS_GIT_VERSION=4.6.0-202107291702.p0.git.cc06fc6-cc06fc6 SOURCE_DATE_EPOCH=1613066017 SOURCE_GIT_COMMIT=cc06fc6ba3ffef27180f9c6ca21fb1e129727ded SOURCE_GIT_TAG=v2.8.2-33-gcc06fc6ba SOURCE_GIT_URL=https://github.com/kube-reporting/helm 

COPY --from=build /go/src/k8s.io/helm/rootfs/tiller /usr/local/bin
COPY --from=build /go/src/k8s.io/helm/bin/helm /usr/local/bin
RUN ln -s /usr/local/bin/tiller /tiller

LABEL \
        io.k8s.display-name="OpenShift metering-helm" \
        io.k8s.description="This is a base image used by operator-metering to assist in managing the lifecycle of the Openshift Metering components." \
        io.openshift.tags="openshift" \
        maintainer="<metering-team@redhat.com>" \
        name="openshift/ose-metering-helm" \
        com.redhat.component="ose-metering-helm-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Metering Operator" \
        release="202107291702.p0.git.cc06fc6" \
        io.openshift.build.commit.id="cc06fc6ba3ffef27180f9c6ca21fb1e129727ded" \
        io.openshift.build.source-location="https://github.com/kube-reporting/helm" \
        io.openshift.build.commit.url="https://github.com/kube-reporting/helm/commit/cc06fc6ba3ffef27180f9c6ca21fb1e129727ded" \
        version="v4.6.0"

