Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C61752004F5 for ; Fri, 11 Aug 2017 12:11:43 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C4C7A16D0E3; Fri, 11 Aug 2017 10:11:43 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1C10016D0D8 for ; Fri, 11 Aug 2017 12:11:42 +0200 (CEST) Received: (qmail 11856 invoked by uid 500); 11 Aug 2017 10:11:42 -0000 Mailing-List: contact commits-help@bookkeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: bookkeeper-dev@bookkeeper.apache.org Delivered-To: mailing list commits@bookkeeper.apache.org Received: (qmail 11841 invoked by uid 99); 11 Aug 2017 10:11:42 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Aug 2017 10:11:42 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 84A4A81276; Fri, 11 Aug 2017 10:11:37 +0000 (UTC) Date: Fri, 11 Aug 2017 10:11:44 +0000 To: "commits@bookkeeper.apache.org" Subject: [bookkeeper] 07/10: 406 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: sijie@apache.org Reply-To: "commits@bookkeeper.apache.org" In-Reply-To: <150244629712.16261.13174649489097510329@gitbox.apache.org> References: <150244629712.16261.13174649489097510329@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: bookkeeper X-Git-Refname: refs/heads/branch-4.5 X-Git-Reftype: branch X-Git-Rev: 17721bc111dc69f1ddfba45857d0d1878bf300f3 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20170811101138.84A4A81276@gitbox.apache.org> archived-at: Fri, 11 Aug 2017 10:11:43 -0000 This is an automated email from the ASF dual-hosted git repository. sijie pushed a commit to branch branch-4.5 in repository https://gitbox.apache.org/repos/asf/bookkeeper.git commit 17721bc111dc69f1ddfba45857d0d1878bf300f3 Author: Francesco Caliumi - Diennea 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 Reviewers: Jia Zhai , Matteo Merli , Sijie Guo 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" .