blob: 1c9ad67daa5f5018354ac9808216b27b51f9124a [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 RANGER_VERSION
COPY ./dist/version /home/ranger/dist/
COPY ./dist/ranger-${RANGER_VERSION}-tagsync.tar.gz /home/ranger/dist/
COPY ./scripts/ranger-tagsync.sh ${RANGER_SCRIPTS}/
COPY ./scripts/ranger-tagsync-install.properties ${RANGER_SCRIPTS}/
COPY ./scripts/ranger-tagsync-tags.json ${RANGER_SCRIPTS}/
RUN tar xvfz /home/ranger/dist/ranger-${RANGER_VERSION}-tagsync.tar.gz --directory=${RANGER_HOME} && \
ln -s ${RANGER_HOME}/ranger-${RANGER_VERSION}-tagsync ${RANGER_HOME}/tagsync && \
rm -f /home/ranger/dist/ranger-${RANGER_VERSION}-tagsync.tar.gz && \
mkdir -p /opt/ranger/tagsync/data && \
cp -f ${RANGER_SCRIPTS}/ranger-tagsync-install.properties ${RANGER_HOME}/tagsync/install.properties && \
cp -f ${RANGER_SCRIPTS}/ranger-tagsync-tags.json ${RANGER_HOME}/tagsync/data/tags.json && \
mkdir -p /var/run/ranger && \
mkdir -p /var/log/ranger/tagsync && \
ln -s /usr/bin/python3 /usr/bin/python && \
mkdir -p /etc/ranger && \
touch /etc/init.d/ranger-tagsync && \
ln -s /etc/init.d/ranger-tagsync /etc/rc2.d/S99ranger-tagsync && \
ln -s /etc/init.d/ranger-tagsync /etc/rc2.d/K00ranger-tagsync && \
ln -s /etc/init.d/ranger-tagsync /etc/rc3.d/S99ranger-tagsync && \
ln -s /etc/init.d/ranger-tagsync /etc/rc3.d/K00ranger-tagsync && \
ln -s ${RANGER_HOME}/tagsync/ranger-tagsync-services.sh /usr/bin/ranger-tagsync-services.sh && \
chown -R ranger:ranger ${RANGER_HOME}/tagsync/ ${RANGER_SCRIPTS}/ /var/run/ranger/ /var/log/ranger/ /etc/ranger /etc/init.d/ranger-tagsync && \
chmod 744 ${RANGER_SCRIPTS}/ranger-tagsync.sh
USER ranger
ENTRYPOINT [ "/home/ranger/scripts/ranger-tagsync.sh" ]