blob: bd31629140b6167a8551a76eccf93402786f5ea2 [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
FROM ranger-base:latest
ARG HIVE_VERSION
ARG HIVE_HADOOP_VERSION
ARG RANGER_VERSION
COPY ./dist/version /home/ranger/dist/
COPY ./dist/ranger-${RANGER_VERSION}-hive-plugin.tar.gz /home/ranger/dist/
COPY ./scripts/ranger-hive-setup.sh /home/ranger/scripts/
COPY ./scripts/ranger-hive.sh /home/ranger/scripts/
COPY ./scripts/ranger-hive-plugin-install.properties /home/ranger/scripts/
COPY ./scripts/hive-site.xml /home/ranger/scripts/
RUN curl https://archive.apache.org/dist/hive/hive-${HIVE_VERSION}/apache-hive-${HIVE_VERSION}-bin.tar.gz --output /tmp/apache-hive-${HIVE_VERSION}-bin.tar.gz && \
tar xvfz /tmp/apache-hive-${HIVE_VERSION}-bin.tar.gz --directory=/opt/ && \
ln -s /opt/apache-hive-${HIVE_VERSION}-bin /opt/hive && \
rm -f /tmp/apache-hive-${HIVE_VERSION}-bin.tar.gz && \
curl https://archive.apache.org/dist/hadoop/common/hadoop-${HIVE_HADOOP_VERSION}/hadoop-${HIVE_HADOOP_VERSION}.tar.gz --output /tmp/hadoop-${HIVE_HADOOP_VERSION}.tar.gz && \
tar xvfz /tmp/hadoop-${HIVE_HADOOP_VERSION}.tar.gz --directory=/opt/ && \
ln -s /opt/hadoop-${HIVE_HADOOP_VERSION} /opt/hadoop && \
rm -f /tmp/hadoop-${HIVE_HADOOP_VERSION}.tar.gz && \
tar xvfz /home/ranger/dist/ranger-${RANGER_VERSION}-hive-plugin.tar.gz --directory=/opt/ranger && \
ln -s /opt/ranger/ranger-${RANGER_VERSION}-hive-plugin /opt/ranger/ranger-hive-plugin && \
rm -f /home/ranger/dist/ranger-${RANGER_VERSION}-hive-plugin.tar.gz && \
cp -f /home/ranger/scripts/ranger-hive-plugin-install.properties /opt/ranger/ranger-hive-plugin/install.properties
ENV HIVE_HOME /opt/hive
ENV HADOOP_HOME /opt/hadoop
ENV PATH /usr/java/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/hive/bin:/opt/hadoop/bin
ENTRYPOINT [ "/home/ranger/scripts/ranger-hive.sh" ]