| # 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. |
| |
| # see https://hub.docker.com/_/eclipse-temurin/tags |
| ARG RANGER_BASE_JAVA_VERSION=8 |
| |
| # Ubuntu 22.04 LTS |
| FROM eclipse-temurin:${RANGER_BASE_JAVA_VERSION}-jdk-jammy |
| |
| # Install packages |
| RUN apt update -q \ |
| && DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends \ |
| bc \ |
| curl \ |
| iputils-ping \ |
| pdsh \ |
| python3 \ |
| python3-pip \ |
| python-is-python3 \ |
| ssh \ |
| tzdata \ |
| vim \ |
| xmlstarlet \ |
| krb5-user \ |
| && apt clean |
| |
| # Install Python modules |
| RUN pip install apache-ranger requests \ |
| && rm -rf ~/.cache/pip |
| |
| # Set environment variables |
| ENV RANGER_DIST=/home/ranger/dist |
| ENV RANGER_SCRIPTS=/home/ranger/scripts |
| ENV RANGER_HOME=/opt/ranger |
| ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
| |
| # create directories and setup perms |
| RUN mkdir -p ${RANGER_DIST} ${RANGER_SCRIPTS} ${RANGER_HOME} && \ |
| chmod +rx /home/ranger ${RANGER_DIST} ${RANGER_SCRIPTS} |
| |
| # setup groups and users |
| COPY docker/create_users_and_groups.sh ${RANGER_SCRIPTS} |
| RUN chmod +x ${RANGER_SCRIPTS}/create_users_and_groups.sh && \ |
| ${RANGER_SCRIPTS}/create_users_and_groups.sh |
| |
| # Create opensearch user and group |
| RUN groupadd -g 3002 opensearch && \ |
| useradd -u 3002 -g opensearch -G hadoop -s /bin/bash opensearch |
| |
| # copy kerberos utility scripts |
| COPY docker/krb/* ${RANGER_SCRIPTS} |
| RUN chmod 755 ${RANGER_SCRIPTS}/wait_for_keytab.sh && \ |
| chmod 755 ${RANGER_SCRIPTS}/wait_for_testusers_keytab.sh |
| |
| # change ownerships |
| RUN chown -R ranger:ranger /home/ranger /opt/ranger |
| |
| ENTRYPOINT [ "/bin/bash" ] |