FROM openshift/golang-builder:1.13 AS builder
ENV __doozer=update BUILD_RELEASE=202007240028.p0 BUILD_VERSION=v4.4.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=4 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.4.0-202007240028.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=1cc20a5 OS_GIT_VERSION=4.4.0-202007240028.p0-1cc20a5 SOURCE_DATE_EPOCH=1595546618 SOURCE_GIT_COMMIT=1cc20a54a904649f9497ab629b1662ff3d92d304 SOURCE_GIT_TAG=1cc20a54 SOURCE_GIT_URL=https://github.com/openshift/cluster-logging-operator 
WORKDIR /go/src/github.com/openshift/cluster-logging-operator
COPY . .
RUN make

FROM openshift/ose-base:v4.4.0-202007232108.p0
ENV __doozer=update BUILD_RELEASE=202007240028.p0 BUILD_VERSION=v4.4.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=4 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.4.0-202007240028.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=1cc20a5 OS_GIT_VERSION=4.4.0-202007240028.p0-1cc20a5 SOURCE_DATE_EPOCH=1595546618 SOURCE_GIT_COMMIT=1cc20a54a904649f9497ab629b1662ff3d92d304 SOURCE_GIT_TAG=1cc20a54 SOURCE_GIT_URL=https://github.com/openshift/cluster-logging-operator 
ARG CSV=4.4
RUN INSTALL_PKGS=" \
      openssl \
      " && \
    yum install -y $INSTALL_PKGS && \
    rpm -V $INSTALL_PKGS && \
    yum clean all && \
    mkdir /tmp/ocp-clo && \
    chmod og+w /tmp/ocp-clo
COPY --from=builder /go/src/github.com/openshift/cluster-logging-operator/_output/bin/cluster-logging-operator /usr/bin/
COPY scripts/* /usr/bin/scripts/
RUN mkdir -p /usr/share/logging/
COPY files/ /usr/share/logging/

COPY --from=builder /go/src/github.com/openshift/cluster-logging-operator/manifests /manifests
RUN rm /manifests/art.yaml

# this is required because the operator invokes a script as `bash scripts/cert_generation.sh`
WORKDIR /usr/bin
ENTRYPOINT ["/usr/bin/cluster-logging-operator"]

LABEL \
        io.k8s.display-name="Cluster Logging Operator" \
        io.k8s.description="This is a component of OpenShift Container Platform that manages the lifecycle of the Aggregated logging stack." \
        io.openshift.tags="openshift,logging" \
        com.redhat.delivery.appregistry="false" \
        maintainer="AOS Logging <aos-logging@redhat.com>" \
        License="GPLv2+" \
        name="openshift/ose-cluster-logging-operator" \
        com.redhat.component="cluster-logging-operator-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        release="202007240028.p0" \
        io.openshift.build.commit.id="1cc20a54a904649f9497ab629b1662ff3d92d304" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-logging-operator" \
        io.openshift.build.commit.url="https://github.com/openshift/cluster-logging-operator/commit/1cc20a54a904649f9497ab629b1662ff3d92d304" \
        version="v4.4.0"

