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