This is an automated email from the ASF dual-hosted git repository.

aengineer pushed a commit to branch docker-hadoop-runner-jdk11
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/docker-hadoop-runner-jdk11 by 
this push:
     new 22597d3  HDDS-1632. Make the hadoop home word readable and avoid sudo 
in hadoop-runner.
22597d3 is described below

commit 22597d33acf67d1c0f963e2c79f7534e9dc5bf0d
Author: Elek, Márton <[email protected]>
AuthorDate: Tue Jun 4 08:15:52 2019 +0200

    HDDS-1632. Make the hadoop home word readable and avoid sudo in 
hadoop-runner.
---
 Dockerfile         | 4 ++--
 scripts/starter.sh | 5 +----
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 20f5d31..fd7c40c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -31,6 +31,7 @@ ENV PATH $PATH:/opt/hadoop/bin
 
 RUN groupadd --gid 1000 hadoop
 RUN useradd --uid 1000 hadoop --gid 100 --home /opt/hadoop
+RUN chmod 755 /opt/hadoop
 RUN echo "hadoop ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
 RUN chown hadoop /opt
 ADD scripts /opt/
@@ -40,7 +41,6 @@ RUN mkdir -p /etc/hadoop && mkdir -p /var/log/hadoop && chmod 
1777 /etc/hadoop &
 ENV HADOOP_LOG_DIR=/var/log/hadoop
 ENV HADOOP_CONF_DIR=/etc/hadoop
 WORKDIR /opt/hadoop
-
-VOLUME /data
+RUN mkdir /data && chmod 1777 /data
 USER hadoop
 ENTRYPOINT ["/usr/local/bin/dumb-init", "--", "/opt/starter.sh"]
diff --git a/scripts/starter.sh b/scripts/starter.sh
index 1328607..6b5bbe2 100755
--- a/scripts/starter.sh
+++ b/scripts/starter.sh
@@ -96,9 +96,6 @@ if [ -n "$KERBEROS_ENABLED" ]; then
     sed "s/SERVER/$KERBEROS_SERVER/g" "$DIR"/krb5.conf | sudo tee 
/etc/krb5.conf
 fi
 
-#To avoid docker volume permission problems
-sudo chmod o+rwx /data
-
 "$DIR"/envtoconf.py --destination "${HADOOP_CONF_DIR:-/opt/hadoop/etc/hadoop}"
 
 if [ -n "$ENSURE_NAMENODE_DIR" ]; then
@@ -139,7 +136,7 @@ if [ -n "$BYTEMAN_SCRIPT" ] || [ -n "$BYTEMAN_SCRIPT_URL" 
]; then
   export PATH=$PATH:$BYTEMAN_DIR/bin
 
   if [ ! -z "$BYTEMAN_SCRIPT_URL" ]; then
-    sudo wget $BYTEMAN_SCRIPT_URL -O /tmp/byteman.btm
+    wget $BYTEMAN_SCRIPT_URL -O /tmp/byteman.btm
     export BYTEMAN_SCRIPT=/tmp/byteman.btm
   fi
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to