You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by gh...@apache.org on 2020/10/21 15:48:10 UTC

[bookkeeper] branch master updated: Fix JAVA_HOME in Dockerimage and allow it to be overwritten

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

ghatage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new d806c22  Fix JAVA_HOME in Dockerimage and allow it to be overwritten
d806c22 is described below

commit d806c222235271ea381e2be9e19fba9df9257c5b
Author: Enrico Olivelli <eo...@gmail.com>
AuthorDate: Wed Oct 21 17:47:59 2020 +0200

    Fix JAVA_HOME in Dockerimage and allow it to be overwritten
    
    - Fix Java 11 Path in Dockerfile
    - Allow to overwrite JAVA_HOME in entrypoint.sh and healthcheck.sh
    
    Reviewers: Ravi Sharda <None>
    
    This closes #2449 from eolivelli/fix/docker-image-jdk11-2
---
 docker/Dockerfile             | 2 +-
 docker/README.md              | 2 +-
 docker/docker-compose.yml     | 6 +++---
 docker/hooks/build            | 1 +
 docker/scripts/entrypoint.sh  | 1 -
 docker/scripts/healthcheck.sh | 2 --
 6 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/docker/Dockerfile b/docker/Dockerfile
index 61d2d4d..eac6a58 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -28,7 +28,7 @@ ENV BOOKIE_PORT=3181
 EXPOSE $BOOKIE_PORT
 ENV BK_USER=bookkeeper
 ENV BK_HOME=/opt/bookkeeper
-ENV JAVA_HOME=/usr/lib/jvm/jdk-11
+ENV JAVA_HOME=/usr/lib/jvm/java-11
 
 # Download Apache Bookkeeper, untar and clean up
 RUN set -x \
diff --git a/docker/README.md b/docker/README.md
index 9d30371..110a70c 100644
--- a/docker/README.md
+++ b/docker/README.md
@@ -13,7 +13,7 @@ Bookkeeper needs [Zookeeper](https://zookeeper.apache.org/) in order to preserve
 Just like running a BookKeeper cluster in one machine(http://bookkeeper.apache.org/docs/latest/getting-started/run-locally/), you can run a standalone BookKeeper in one docker container, the command is:
 ```
 docker run -it \
-     --env JAVA_HOME=/usr/lib/jvm/jdk-11 \
+     --env JAVA_HOME=/usr/lib/jvm/java-11 \
      --entrypoint "/bin/bash" \
      apache/bookkeeper \
      -c "/opt/bookkeeper/bin/bookkeeper localbookie 3"
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index c99787b..a2b9136 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -28,7 +28,7 @@ services:
     links:
       - zookeeper
     environment:
-      - JAVA_HOME=/usr/lib/jvm/jdk-11
+      - JAVA_HOME=/usr/lib/jvm/java-11
       - BK_zkServers=zookeeper:2181
       - BK_zkLedgersRootPath=/ledgers
 
@@ -38,7 +38,7 @@ services:
     links:
       - zookeeper
     environment:
-      - JAVA_HOME=/usr/lib/jvm/jdk-11
+      - JAVA_HOME=/usr/lib/jvm/java-11
       - BK_zkServers=zookeeper:2181
       - BK_zkLedgersRootPath=/ledgers
 
@@ -48,7 +48,7 @@ services:
     links:
       - zookeeper
     environment:
-      - JAVA_HOME=/usr/lib/jvm/jdk-11
+      - JAVA_HOME=/usr/lib/jvm/java-11
       - BK_zkServers=zookeeper:2181
       - BK_zkLedgersRootPath=/ledgers
 
diff --git a/docker/hooks/build b/docker/hooks/build
index 653f5df..c7b0faa 100755
--- a/docker/hooks/build
+++ b/docker/hooks/build
@@ -1,4 +1,5 @@
 #!/bin/bash
+set -x
 # When we build 'latest' tag we want to not override BK_VERSION variable
 if [[ "$DOCKER_TAG" = "latest" ]]
 then
diff --git a/docker/scripts/entrypoint.sh b/docker/scripts/entrypoint.sh
index fec1762..657eb6b 100755
--- a/docker/scripts/entrypoint.sh
+++ b/docker/scripts/entrypoint.sh
@@ -21,7 +21,6 @@
 # */
 
 export PATH=$PATH:/opt/bookkeeper/bin
-export JAVA_HOME=/usr/lib/jvm/jdk-11
 
 BK_HOME=/opt/bookkeeper
 BINDIR=${BK_HOME}/bin
diff --git a/docker/scripts/healthcheck.sh b/docker/scripts/healthcheck.sh
index 70c57e2..2fa30a1 100755
--- a/docker/scripts/healthcheck.sh
+++ b/docker/scripts/healthcheck.sh
@@ -24,8 +24,6 @@
 
 set -x -e -u
 
-export JAVA_HOME=/usr/lib/jvm/jdk-11
-
 # Sanity check that creates a ledger, writes a few entries, reads them and deletes the ledger.
 DEFAULT_HEALTH_CHECK_CMD="/opt/bookkeeper/bin/bookkeeper shell bookiesanity"