| # 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 KAFKA_VERSION |
| ARG RANGER_VERSION |
| |
| |
| COPY ./dist/version /home/ranger/dist/ |
| COPY ./dist/ranger-${RANGER_VERSION}-kafka-plugin.tar.gz /home/ranger/dist/ |
| COPY ./downloads/kafka_2.12-${KAFKA_VERSION}.tgz /home/ranger/dist/ |
| |
| COPY ./scripts/ranger-kafka-setup.sh /home/ranger/scripts/ |
| COPY ./scripts/ranger-kafka.sh /home/ranger/scripts/ |
| COPY ./scripts/ranger-kafka-plugin-install.properties /home/ranger/scripts/ |
| |
| RUN tar xvfz /home/ranger/dist/kafka_2.12-${KAFKA_VERSION}.tgz --directory=/opt/ && \ |
| ln -s /opt/kafka_2.12-${KAFKA_VERSION} /opt/kafka && \ |
| rm -f /home/ranger/dist/kafka_2.12-${KAFKA_VERSION}.tgz && \ |
| tar xvfz /home/ranger/dist/ranger-${RANGER_VERSION}-kafka-plugin.tar.gz --directory=/opt/ranger && \ |
| ln -s /opt/ranger/ranger-${RANGER_VERSION}-kafka-plugin /opt/ranger/ranger-kafka-plugin && \ |
| rm -f /home/ranger/dist/ranger-${RANGER_VERSION}-kafka-plugin.tar.gz && \ |
| cp -f /home/ranger/scripts/ranger-kafka-plugin-install.properties /opt/ranger/ranger-kafka-plugin/install.properties && \ |
| chmod 744 ${RANGER_SCRIPTS}/ranger-kafka-setup.sh ${RANGER_SCRIPTS}/ranger-kafka.sh |
| |
| ENV KAFKA_HOME /opt/kafka |
| ENV PATH /usr/java/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/kafka/bin |
| |
| ENTRYPOINT [ "/home/ranger/scripts/ranger-kafka.sh" ] |