bookkeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From si...@apache.org
Subject [bookkeeper] 03/04: 406
Date Sat, 12 Aug 2017 01:42:37 GMT
This is an automated email from the ASF dual-hosted git repository.

sijie pushed a commit to tag release-4.5.0
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit 53ee5a61b1ccc830ffb971fb66c72cceeb38862b
Author: Francesco Caliumi - Diennea <francesco.caliumi@diennea.com>
AuthorDate: Tue Aug 8 07:56:06 2017 +0800

    406
    
    Descriptions of the changes in this PR:
    - Fix non-privileged user execution
    - Change the Makefile in order to always use current user when run the bk image
    - Fix Makefile in order to run "make run-demo"
    - Adjust unneeded packages remove in Dockerfile
    
    Author: Francesco Caliumi - Diennea <francesco.caliumi@diennea.com>
    
    Reviewers: Jia Zhai <None>, Matteo Merli <None>, Sijie Guo <None>
    
    This closes #406 from caiok/master
---
 docker/Dockerfile            | 4 ++--
 docker/Makefile              | 2 ++
 docker/scripts/entrypoint.sh | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/docker/Dockerfile b/docker/Dockerfile
index 45d422e..5a22bb6 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -31,7 +31,7 @@ ENV BK_USER=bookkeeper
 # Download Apache Bookkeeper, untar and clean up
 RUN set -x \
     && adduser "${BK_USER}" \
-    && yum install -y java-1.8.0-openjdk-headless wget bash python md5sum sha1sum
\
+    && yum install -y java-1.8.0-openjdk-headless wget bash python md5sum sha1sum
sudo \
     && mkdir -pv /opt \
     && cd /opt \
     && wget -q "https://archive.apache.org/dist/bookkeeper/bookkeeper-${BK_VERSION}/${DISTRO_NAME}.tar.gz"
\
@@ -45,7 +45,7 @@ RUN set -x \
     && tar -xzf "$DISTRO_NAME.tar.gz" \
     && mv bookkeeper-server-${BK_VERSION}/ /opt/bookkeeper/ \
     && rm -rf "$DISTRO_NAME.tar.gz" "$DISTRO_NAME.tar.gz.asc" "$DISTRO_NAME.tar.gz.md5"
"$DISTRO_NAME.tar.gz.sha1" \
-    && yum remove -y wget \
+    && yum remove -y wget md5sum sha1sum \
     && yum clean all
 
 WORKDIR /opt/bookkeeper
diff --git a/docker/Makefile b/docker/Makefile
index 27c8ce6..64078db 100644
--- a/docker/Makefile
+++ b/docker/Makefile
@@ -38,6 +38,7 @@ BK_zkLedgersRootPath = /ledgers
 ZK_CONTAINER_NAME=test_zookeeper
 ZK_LOCAL_DATA_DIR=$(BK_LOCAL_DATA_DIR)/zookkeeper
 
+TERMINAL_EMULATOR=gnome-terminal
 
 CONTAINER_IP=$(shell docker inspect --format '{{ .NetworkSettings.IPAddress }}' $(CONTAINER_NAME))
 
@@ -78,6 +79,7 @@ run-bk:
 	    --volume $(BK_LOCAL_CONTAINER_DATA_DIR)/journal:$(BK_DIR)/journal \
 	    --volume $(BK_LOCAL_CONTAINER_DATA_DIR)/ledger:$(BK_DIR)/ledger \
 	    --volume $(BK_LOCAL_CONTAINER_DATA_DIR)/index:$(BK_DIR)/index \
+            --user "$(id -u)" \
 	    --name "$(CONTAINER_NAME)" \
 	    --hostname "$(CONTAINER_NAME)" \
 	    --env BK_zkServers=$(ZK_CONTAINER_NAME):2181 \
diff --git a/docker/scripts/entrypoint.sh b/docker/scripts/entrypoint.sh
index 310970a..dffbc93 100755
--- a/docker/scripts/entrypoint.sh
+++ b/docker/scripts/entrypoint.sh
@@ -46,7 +46,7 @@ echo "BK_CLUSTER_ROOT_PATH is $BK_CLUSTER_ROOT_PATH"
 mkdir -p "${BK_journalDirectory}" "${BK_ledgerDirectories}" "${BK_indexDirectories}"
 # -------------- #
 # Allow the container to be started with `--user`
-if [ "$1" = 'bookkeeper' -a "$(id -u)" = '0' ]; then
+if [ "$1" = '/opt/bookkeeper/bin/bookkeeper' -a "$(id -u)" = '0' ]; then
     chown -R "$BK_USER:$BK_USER" "/opt/bookkeeper/" "${BK_journalDirectory}" "${BK_ledgerDirectories}"
"${BK_indexDirectories}"
     sudo -s -E -u "$BK_USER" /bin/bash "$0" "$@"
     exit

-- 
To stop receiving notification emails like this one, please contact
"commits@bookkeeper.apache.org" <commits@bookkeeper.apache.org>.

Mime
View raw message