You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ae...@apache.org on 2019/05/16 14:47:12 UTC
[hadoop] branch docker-hadoop-runner-jdk8 updated: HDDS-1518. Use
/etc/ozone for configuration inside docker-compose. Contributed by Elek,
Marton.
This is an automated email from the ASF dual-hosted git repository.
aengineer pushed a commit to branch docker-hadoop-runner-jdk8
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/docker-hadoop-runner-jdk8 by this push:
new cc0bd3c HDDS-1518. Use /etc/ozone for configuration inside docker-compose. Contributed by Elek, Marton.
cc0bd3c is described below
commit cc0bd3ccbb780ef2d9de2212a81e8a755d5767f1
Author: Anu Engineer <ae...@apache.org>
AuthorDate: Thu May 16 15:02:43 2019 +0200
HDDS-1518. Use /etc/ozone for configuration inside docker-compose.
Contributed by Elek, Marton.
(cherry picked from commit ac814f15b15a0f70cab96fd7262a31477af6e2a8)
---
Dockerfile | 4 +++-
scripts/envtoconf.py | 4 +++-
scripts/starter.sh | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index d06cb82..21299df 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -36,7 +36,9 @@ RUN chown hadoop /opt
ADD scripts /opt/
ADD scripts/krb5.conf /etc/
RUN yum install -y krb5-workstation
-
+RUN mkdir -p /etc/hadoop && mkdir -p /var/log/hadoop && chmod 1777 /etc/hadoop && chmod 1777 /var/log/hadoop
+ENV HADOOP_LOG_DIR=/var/log/hadoop
+ENV HADOOP_CONF_DIR=/etc/hadoop
WORKDIR /opt/hadoop
VOLUME /data
diff --git a/scripts/envtoconf.py b/scripts/envtoconf.py
index ad2e176..0e2c368 100755
--- a/scripts/envtoconf.py
+++ b/scripts/envtoconf.py
@@ -36,7 +36,7 @@ class Simple(object):
self.known_formats = ['xml', 'properties', 'yaml', 'yml', 'env', "sh", "cfg", 'conf']
self.output_dir = self.args.destination
-
+ self.excluded_envs = ['HADOOP_CONF_DIR']
self.configurables = {}
def destination_file_path(self, name, extension):
@@ -51,6 +51,8 @@ class Simple(object):
def process_envs(self):
"""Process environment variables"""
for key in os.environ.keys():
+ if key in self.excluded_envs:
+ continue
pattern = re.compile("[_\\.]")
parts = pattern.split(key)
extension = None
diff --git a/scripts/starter.sh b/scripts/starter.sh
index 7688ce7..1328607 100755
--- a/scripts/starter.sh
+++ b/scripts/starter.sh
@@ -99,7 +99,7 @@ fi
#To avoid docker volume permission problems
sudo chmod o+rwx /data
-"$DIR"/envtoconf.py --destination /opt/hadoop/etc/hadoop
+"$DIR"/envtoconf.py --destination "${HADOOP_CONF_DIR:-/opt/hadoop/etc/hadoop}"
if [ -n "$ENSURE_NAMENODE_DIR" ]; then
CLUSTERID_OPTS=""
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org