| # 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 HADOOP_VERSION |
| ARG HDFS_PLUGIN_VERSION |
| ARG YARN_PLUGIN_VERSION |
| |
| |
| COPY ./dist/version /home/ranger/dist/ |
| COPY ./dist/ranger-${HDFS_PLUGIN_VERSION}-hdfs-plugin.tar.gz /home/ranger/dist/ |
| COPY ./dist/ranger-${YARN_PLUGIN_VERSION}-yarn-plugin.tar.gz /home/ranger/dist/ |
| COPY ./downloads/hadoop-${HADOOP_VERSION}.tar.gz /home/ranger/dist/ |
| |
| COPY ./scripts/ranger-hadoop-setup.sh /home/ranger/scripts/ |
| COPY ./scripts/ranger-hadoop.sh /home/ranger/scripts/ |
| COPY ./scripts/ranger-hadoop-mkdir.sh /home/ranger/scripts/ |
| COPY ./scripts/ranger-hdfs-plugin-install.properties /home/ranger/scripts/ |
| COPY ./scripts/ranger-yarn-plugin-install.properties /home/ranger/scripts/ |
| |
| RUN tar xvfz /home/ranger/dist/hadoop-${HADOOP_VERSION}.tar.gz --directory=/opt/ && \ |
| ln -s /opt/hadoop-${HADOOP_VERSION} /opt/hadoop && \ |
| rm -f /home/ranger/dist/hadoop-${HADOOP_VERSION}.tar.gz && \ |
| tar xvfz /home/ranger/dist/ranger-${HDFS_PLUGIN_VERSION}-hdfs-plugin.tar.gz --directory=/opt/ranger && \ |
| ln -s /opt/ranger/ranger-${HDFS_PLUGIN_VERSION}-hdfs-plugin /opt/ranger/ranger-hdfs-plugin && \ |
| rm -f /home/ranger/dist/ranger-${HDFS_PLUGIN_VERSION}-hdfs-plugin.tar.gz && \ |
| cp -f /home/ranger/scripts/ranger-hdfs-plugin-install.properties /opt/ranger/ranger-hdfs-plugin/install.properties && \ |
| tar xvfz /home/ranger/dist/ranger-${YARN_PLUGIN_VERSION}-yarn-plugin.tar.gz --directory=/opt/ranger && \ |
| ln -s /opt/ranger/ranger-${YARN_PLUGIN_VERSION}-yarn-plugin /opt/ranger/ranger-yarn-plugin && \ |
| rm -f /home/ranger/dist/ranger-${YARN_PLUGIN_VERSION}-yarn-plugin.tar.gz && \ |
| cp -f /home/ranger/scripts/ranger-yarn-plugin-install.properties /opt/ranger/ranger-yarn-plugin/install.properties && \ |
| chmod 744 ${RANGER_SCRIPTS}/ranger-hadoop-setup.sh ${RANGER_SCRIPTS}/ranger-hadoop.sh ${RANGER_SCRIPTS}/ranger-hadoop-mkdir.sh && \ |
| chown hdfs:hadoop ${RANGER_SCRIPTS}/ranger-hadoop-mkdir.sh |
| |
| ENV HADOOP_HOME /opt/hadoop |
| ENV HADOOP_CONF_DIR /opt/hadoop/etc/hadoop |
| ENV HADOOP_HDFS_HOME /opt/hadoop |
| ENV HADOOP_MAPRED_HOME /opt/hadoop |
| ENV HADOOP_COMMON_HOME /opt/hadoop |
| ENV YARN_HOME /opt/hadoop |
| ENV PATH /usr/java/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/hadoop/bin |
| |
| ENTRYPOINT [ "/home/ranger/scripts/ranger-hadoop.sh" ] |