# Copyright 2017 Red Hat
#
# 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.
#
# ------------------------------------------------------------------------
#
# This is a Dockerfile for the rhdm-7/rhdm71-decisioncentral-indexing:7.1.1 image.

FROM jboss/openjdk18-rhel7:1.1

# Environment variables
ENV \
    ELASTICSEARCH_DISTRIBUTION_ZIP="elasticsearch-5.6.5.zip" \
    ELASTICSEARCH_HOME="/opt/elasticsearch" \
    ELASTICSEARCH_VERSION="5.6.5" \
    JBOSS_IMAGE_NAME="rhdm-7/rhdm71-decisioncentral-indexing" \
    JBOSS_IMAGE_VERSION="7.1.1" \
    JBOSS_PRODUCT="rhdm-decisioncentral-indexing" \
    PRODUCT_VERSION="7.1.1" \
    RHDM_BUSINESS_CENTRAL_INDEXING_VERSION="7.1.1" 

# Labels
LABEL \
      com.redhat.component="rhdm-7-rhdm71-decisioncentral-indexing-container"  \
      description="Red Hat Decision Central Indexing 7.1 Container Image"  \
      elasticsearch.version="5.6.5"  \
      io.cekit.version="2.1.4"  \
      name="rhdm-7/rhdm71-decisioncentral-indexing"  \
      org.concrt.version="2.1.4"  \
      org.jboss.product="rhdm-decisioncentral-indexing"  \
      org.jboss.product.rhdm-decisioncentral-indexing.version="7.1.1"  \
      org.jboss.product.version="7.1.1"  \
      summary="Red Hat Decision Central Indexing 7.1 Container Image"  \
      version="7.1.1" 


USER root


# Install required RPMs and ensure that the packages were installed
RUN yum install -y hostname \
    && yum clean all && rm -rf /var/cache/yum && \
    rpm -q  hostname

# Add all artifacts to the /tmp/artifacts
# directory
COPY \
    elasticsearch-5.6.5.zip \
    /tmp/artifacts/

# Add scripts used to configure the image
COPY modules /tmp/scripts

# Custom scripts
USER root
RUN [ "bash", "-x", "/tmp/scripts/decisioncentral-indexing/install" ]

USER root
RUN rm -rf /tmp/scripts
USER root
RUN rm -rf /tmp/artifacts

USER 185



CMD ["/opt/elasticsearch/bin/elasticsearch"]

