Skip to content

Commit

Permalink
将 bitnami 的环境变量也加入 /etc/profile
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeBottle committed Feb 24, 2024
1 parent b83c148 commit 88607d8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ ENV PATH="$HASPARK_PATH:$PATH" \
# 以免Spark或Hadoop找不到Hadoop Native Library
LD_LIBRARY_PATH="$HASPARK_LD_LIBRARY_PATH:$LD_LIBRARY_PATH" \
# 临时密码文件路径加入环境变量
TEMP_PASS_FILE="/root/temp.pass"
TEMP_PASS_FILE="/root/temp.pass" \
# 保留 Bitnami 的环境变量
BITNAMI_PATHS="/opt/bitnami/python/bin:/opt/bitnami/java/bin:/opt/bitnami/spark/bin:/opt/bitnami/spark/sbin"
# 以下是一些环境变量默认值,用于Hadoop初始化
ENV HADOOP_LAUNCH_MODE="general" \
HADOOP_HDFS_REPLICATION="2" \
Expand All @@ -60,6 +62,8 @@ COPY resources/sources.list /tmp/sources.list

# 将路径环境变量写入/etc/profile.d/path_env.sh
RUN echo -e "#!/bin/bash\nexport PATH=$HASPARK_PATH:\$PATH\nexport LD_LIBRARY_PATH=$HASPARK_LD_LIBRARY_PATH:\$LD_LIBRARY_PATH" > /etc/profile.d/path_env.sh && \
# 将Bitnami环境变量写入/etc/profile.d/bitnami.sh
echo -e "#!/bin/bash\nexport PATH=$BITNAMI_PATHS:\$PATH" > /etc/profile.d/bitnami.sh && \
# 将Hadoop部分环境变量写入/etc/profile.d/hadoop.sh
echo -e "#!/bin/bash\nexport HADOOP_HOME=$HADOOP_HOME\nexport HADOOP_CONF_DIR=$HADOOP_CONF_DIR\nexport HADOOP_LOG_DIR=$HADOOP_LOG_DIR\nexport HADOOP_VER=$HADOOP_VER" >> /etc/profile.d/hadoop.sh && \
# 将Zookeeper部分环境变量写入/etc/profile.d/zookeeper.sh
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ version: '3'

services:
haspark-main:
image: somebottle/haspark:3.1.5
image: somebottle/haspark:3.1.6
hostname: shmain
env_file: ./conf.env
environment:
Expand All @@ -184,7 +184,7 @@ services:
- '9870:9870'
- '19888:19888'
haspark-worker-1:
image: somebottle/haspark:3.1.5
image: somebottle/haspark:3.1.6
hostname: shworker1
env_file: ./conf.env
environment:
Expand All @@ -200,7 +200,7 @@ services:
ports:
- '8081:8081'
haspark-worker-2:
image: somebottle/haspark:3.1.5
image: somebottle/haspark:3.1.6
hostname: shworker2
env_file: ./conf.env
environment:
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'

services:
haspark-main:
image: somebottle/haspark:3.1.5
image: somebottle/haspark:3.1.6
hostname: shmain
env_file: ./conf.env
environment:
Expand All @@ -20,7 +20,7 @@ services:
- '9870:9870'
- '19888:19888'
haspark-worker-1:
image: somebottle/haspark:3.1.5
image: somebottle/haspark:3.1.6
hostname: shworker1
env_file: ./conf.env
environment:
Expand All @@ -36,7 +36,7 @@ services:
ports:
- '8081:8081'
haspark-worker-2:
image: somebottle/haspark:3.1.5
image: somebottle/haspark:3.1.6
hostname: shworker2
env_file: ./conf.env
environment:
Expand Down

0 comments on commit 88607d8

Please sign in to comment.