blob: df467114988c709a439b3f610e5cd6122a3aa4dc [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 KNOX_VERSION
ARG RANGER_VERSION
COPY ./dist/version /home/ranger/dist/
COPY ./dist/ranger-${RANGER_VERSION}-knox-plugin.tar.gz /home/ranger/dist/
COPY ./downloads/knox-${KNOX_VERSION}.tar.gz /home/ranger/dist/
COPY ./scripts/ranger-knox-setup.sh /home/ranger/scripts/
COPY ./scripts/ranger-knox.sh /home/ranger/scripts/
COPY ./scripts/ranger-knox-plugin-install.properties /home/ranger/scripts/
COPY ./scripts/ranger-knox-expect.sh /home/ranger/scripts/
COPY ./scripts/ranger-knox-sandbox.xml /home/ranger/scripts/
RUN apt-get update && apt-get install -y expect && \
tar xvfz /home/ranger/dist/knox-${KNOX_VERSION}.tar.gz --directory=/opt/ && \
ln -s /opt/knox-${KNOX_VERSION} /opt/knox && \
rm -f /home/ranger/dist/knox-${KNOX_VERSION}.tar.gz && \
tar xvfz /home/ranger/dist/ranger-${RANGER_VERSION}-knox-plugin.tar.gz --directory=/opt/ranger && \
ln -s /opt/ranger/ranger-${RANGER_VERSION}-knox-plugin /opt/ranger/ranger-knox-plugin && \
rm -f /home/ranger/dist/ranger-${RANGER_VERSION}-knox-plugin.tar.gz && \
cp -f /home/ranger/scripts/ranger-knox-plugin-install.properties /opt/ranger/ranger-knox-plugin/install.properties && \
cp -f /home/ranger/scripts/ranger-knox-sandbox.xml /opt/knox/conf/topologies/sandbox.xml && \
chmod 744 ${RANGER_SCRIPTS}/ranger-knox-setup.sh ${RANGER_SCRIPTS}/ranger-knox.sh ${RANGER_SCRIPTS}/ranger-knox-expect.sh
ENV KNOX_HOME /opt/knox
ENV PATH /usr/java/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/knox/bin
RUN chmod a+rwx /home/ranger/scripts/ranger-knox-expect.sh
RUN /home/ranger/scripts/ranger-knox-expect.sh
ENTRYPOINT [ "/home/ranger/scripts/ranger-knox.sh" ]