FROM openshift/golang-builder:1.12 AS builder
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=13 OS_GIT_VERSION=4.3.13-202004131016-611501a OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=611501aacb54ba02fd2579ccbba4c1a25740800c SOURCE_GIT_TAG=611501aa SOURCE_GIT_URL=https://github.com/openshift/cluster-logging-operator SOURCE_DATE_EPOCH=1583783085 OS_GIT_COMMIT=611501a BUILD_VERSION=v4.3.13 BUILD_RELEASE=202004131016
WORKDIR /go/src/github.com/openshift/cluster-logging-operator
COPY . .
RUN make

FROM openshift/ose-base:v4.3.13.20200413.101616
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=13 OS_GIT_VERSION=4.3.13-202004131016-611501a OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=611501aacb54ba02fd2579ccbba4c1a25740800c SOURCE_GIT_TAG=611501aa SOURCE_GIT_URL=https://github.com/openshift/cluster-logging-operator SOURCE_DATE_EPOCH=1583783085 OS_GIT_COMMIT=611501a BUILD_VERSION=v4.3.13 BUILD_RELEASE=202004131016
ARG CSV=4.3
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 _output/bin/cluster-logging-operator /usr/bin/
COPY scripts/* /usr/bin/scripts/
RUN mkdir -p /usr/share/logging/
COPY files/ /usr/share/logging/
COPY manifests/$CSV /manifests/$CSV
COPY manifests/cluster-logging.package.yaml /manifests/
# 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" \
        io.openshift.maintainer.component="Logging" \
        version="v4.3.13" \
        release="202004131016" \
        io.openshift.build.commit.id="611501aacb54ba02fd2579ccbba4c1a25740800c" \
        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/611501aacb54ba02fd2579ccbba4c1a25740800c"

