-
Notifications
You must be signed in to change notification settings - Fork 987
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RANGER-3746: Add ranger base image on ubi9-minimal with build and spa…
…ce optimizations
- Loading branch information
abhishek-kumar
committed
Oct 28, 2023
1 parent
de049b9
commit 02f5f35
Showing
6 changed files
with
103 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# 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. | ||
|
||
ARG UBI_VERSION | ||
FROM registry.access.redhat.com/ubi9-minimal:${UBI_VERSION} | ||
|
||
USER root | ||
ARG RANGER_BASE_JAVA_VERSION | ||
ENV OS_NAME RHEL | ||
|
||
RUN microdnf --setopt=install_weak_deps=0 --setopt=tsflags=nodocs \ | ||
install -y java-${RANGER_BASE_JAVA_VERSION}-openjdk-devel \ | ||
&& microdnf clean all \ | ||
&& rpm -q java-${RANGER_BASE_JAVA_VERSION}-openjdk-devel | ||
|
||
ENV JAVA_HOME="/usr/lib/jvm/java-${RANGER_BASE_JAVA_VERSION}" \ | ||
JAVA_VENDOR="openjdk" \ | ||
JAVA_VERSION="${RANGER_BASE_JAVA_VERSION}" \ | ||
JBOSS_CONTAINER_OPENJDK_JDK_MODULE="/opt/jboss/container/openjdk/jdk" | ||
|
||
# Install tzdata, Python, python-requests | ||
RUN microdnf install -y python3 python3-pip bc iputils hostname | ||
RUN microdnf install -y tar procps vim perl | ||
RUN pip3 install apache-ranger | ||
|
||
# Set environment variables | ||
ENV RANGER_HOME /opt/ranger | ||
ENV RANGER_DIST /home/ranger/dist | ||
ENV RANGER_SCRIPTS /home/ranger/scripts | ||
ENV PATH /usr/java/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
|
||
|
||
# setup groups, users, directories | ||
RUN groupadd ranger \ | ||
&& useradd -g ranger -ms /bin/bash ranger \ | ||
&& useradd -g ranger -ms /bin/bash rangeradmin \ | ||
&& useradd -g ranger -ms /bin/bash rangerusersync \ | ||
&& useradd -g ranger -ms /bin/bash rangertagsync \ | ||
&& useradd -g ranger -ms /bin/bash rangerkms \ | ||
&& groupadd hadoop \ | ||
&& useradd -g hadoop -ms /bin/bash hdfs \ | ||
&& useradd -g hadoop -ms /bin/bash yarn \ | ||
&& useradd -g hadoop -ms /bin/bash hive \ | ||
&& useradd -g hadoop -ms /bin/bash hbase \ | ||
&& useradd -g hadoop -ms /bin/bash kafka \ | ||
&& mkdir -p /home/ranger/dist \ | ||
&& mkdir -p /home/ranger/scripts \ | ||
&& chown -R ranger:ranger /home/ranger \ | ||
&& mkdir -p /opt/ranger \ | ||
&& chown -R ranger:ranger /opt/ranger | ||
|
||
ENTRYPOINT [ "/bin/bash" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
dev-support/ranger-docker/docker-compose.ranger-base-ubi.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: '3' | ||
services: | ||
ranger-base: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.ranger-base-ubi | ||
args: | ||
- UBI_VERSION=${UBI_VERSION} | ||
- RANGER_BASE_JAVA_VERSION=${RANGER_BASE_UBI_JAVA_VERSION} | ||
image: ranger-base | ||
container_name: ranger-base | ||
networks: | ||
- ranger | ||
environment: | ||
- RANGER_VERSION | ||
|
||
networks: | ||
ranger: | ||
name: rangernw |