FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=29826dabe5b0ee9a321c5d972e683d7bcae91e39 SOURCE_DATE_EPOCH=1575662315 BUILD_VERSION=v4.2.13 SOURCE_GIT_URL=https://github.com/openshift/cluster-logging-operator SOURCE_GIT_TAG=29826dab BUILD_RELEASE=201912230557
WORKDIR /go/src/github.com/openshift/cluster-logging-operator
COPY . .
RUN make

FROM openshift/ose-base:v4.2.13.20191223.055734
ENV SOURCE_GIT_COMMIT=29826dabe5b0ee9a321c5d972e683d7bcae91e39 SOURCE_DATE_EPOCH=1575662315 BUILD_VERSION=v4.2.13 SOURCE_GIT_URL=https://github.com/openshift/cluster-logging-operator SOURCE_GIT_TAG=29826dab BUILD_RELEASE=201912230557
ARG CSV=4.2
RUN INSTALL_PKGS=" \
      openssl \
      " && \
    yum install -y $INSTALL_PKGS && \
    rpm -V $INSTALL_PKGS && \
    yum clean all && \
    mkdir /tmp/_working_dir && \
    chmod og+w /tmp/_working_dir
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.description="This is a component of OpenShift Container Platform that manages the lifecycle of the Aggregated logging stack." \
        com.redhat.component="cluster-logging-operator-container" \
        maintainer="AOS Logging <aos-logging@redhat.com>" \
        com.redhat.delivery.appregistry="false" \
        License="GPLv2+" \
        io.k8s.display-name="Cluster Logging Operator" \
        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/29826dabe5b0ee9a321c5d972e683d7bcae91e39" \
        version="v4.2.13" \
        io.openshift.build.commit.id="29826dabe5b0ee9a321c5d972e683d7bcae91e39" \
        release="201912230557" \
        io.openshift.tags="openshift,logging" \
        name="openshift/ose-cluster-logging-operator"

