From f07b4835dca7639738f6df4135f8141c85472147 Mon Sep 17 00:00:00 2001 From: Enrico Olivelli Date: Thu, 8 Oct 2020 15:34:49 +0200 Subject: [PATCH 1/4] Update to OpenJDK11 in Docker image --- docker/Dockerfile | 6 +++--- tests/docker-images/current-version-image/Dockerfile | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index f7ed4b1bfc1..570079c81c4 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -20,7 +20,7 @@ FROM centos:7 MAINTAINER Apache BookKeeper -ARG BK_VERSION=4.9.0 +ARG BK_VERSION=4.11.0 ARG DISTRO_NAME=bookkeeper-server-${BK_VERSION}-bin ARG DISTRO_URL=https://archive.apache.org/dist/bookkeeper/bookkeeper-${BK_VERSION}/${DISTRO_NAME}.tar.gz @@ -28,12 +28,12 @@ ENV BOOKIE_PORT=3181 EXPOSE $BOOKIE_PORT ENV BK_USER=bookkeeper ENV BK_HOME=/opt/bookkeeper -ENV JAVA_HOME=/usr/lib/jvm/jre-1.8.0 +ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11 # 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 sudo\ + && yum install -y java-11-openjdk wget bash python sudo\ && mkdir -pv /opt \ && cd /opt \ && wget -q "${DISTRO_URL}" \ diff --git a/tests/docker-images/current-version-image/Dockerfile b/tests/docker-images/current-version-image/Dockerfile index 7a14cc48957..4a99dd75b63 100644 --- a/tests/docker-images/current-version-image/Dockerfile +++ b/tests/docker-images/current-version-image/Dockerfile @@ -30,13 +30,13 @@ ENV BOOKIE_GRPC_PORT=4181 EXPOSE ${BOOKIE_PORT} ${BOOKIE_HTTP_PORT} ${BOOKIE_GRPC_PORT} ENV BK_USER=bookkeeper ENV BK_HOME=/opt/bookkeeper -ENV JAVA_HOME=/usr/lib/jvm/jre-1.8.0 +ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11 # prepare utils RUN set -x \ && adduser "${BK_USER}" \ && yum install -y epel-release \ - && yum install -y java-1.8.0-openjdk-headless wget bash python-pip python-devel sudo netcat gcc gcc-c++ \ + && yum install -y java-11-openjdk wget bash python-pip python-devel sudo netcat gcc gcc-c++ \ && mkdir -pv /opt \ && cd /opt \ # install zookeeper shell From 5ce69bfbe0ca54f1f36c5b3911065222340d2cbc Mon Sep 17 00:00:00 2001 From: Enrico Olivelli Date: Thu, 8 Oct 2020 17:13:42 +0200 Subject: [PATCH 2/4] update jre11 path --- docker/Dockerfile | 5 +++-- docker/README.md | 2 +- docker/docker-compose.yml | 6 +++--- docker/scripts/entrypoint.sh | 2 +- docker/scripts/healthcheck.sh | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 570079c81c4..ae212ca61c6 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/java-11-openjdk-11 +ENV JAVA_HOME=/usr/lib/jvm/jre-11 # Download Apache Bookkeeper, untar and clean up RUN set -x \ @@ -52,7 +52,8 @@ RUN set -x \ && pip install zk-shell \ && rm -rf get-pip.py \ && yum remove -y wget \ - && yum clean all + && yum clean all \ + && ls /usr/lib/jvm WORKDIR /opt/bookkeeper diff --git a/docker/README.md b/docker/README.md index 66fa081271a..5838901eaeb 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/jre-1.8.0 \ + --env JAVA_HOME=/usr/lib/jvm/jre-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 85faada6d11..f218f460bed 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -28,7 +28,7 @@ services: links: - zookeeper environment: - - JAVA_HOME=/usr/lib/jvm/jre-1.8.0 + - JAVA_HOME=/usr/lib/jvm/jre-11 - BK_zkServers=zookeeper:2181 - BK_zkLedgersRootPath=/ledgers @@ -38,7 +38,7 @@ services: links: - zookeeper environment: - - JAVA_HOME=/usr/lib/jvm/jre-1.8.0 + - JAVA_HOME=/usr/lib/jvm/jre-11 - BK_zkServers=zookeeper:2181 - BK_zkLedgersRootPath=/ledgers @@ -48,7 +48,7 @@ services: links: - zookeeper environment: - - JAVA_HOME=/usr/lib/jvm/jre-1.8.0 + - JAVA_HOME=/usr/lib/jvm/jre-11 - BK_zkServers=zookeeper:2181 - BK_zkLedgersRootPath=/ledgers diff --git a/docker/scripts/entrypoint.sh b/docker/scripts/entrypoint.sh index 86911170edd..1cc3c85fcf7 100755 --- a/docker/scripts/entrypoint.sh +++ b/docker/scripts/entrypoint.sh @@ -21,7 +21,7 @@ # */ export PATH=$PATH:/opt/bookkeeper/bin -export JAVA_HOME=/usr/lib/jvm/jre-1.8.0 +export JAVA_HOME=/usr/lib/jvm/jre-11 BK_HOME=/opt/bookkeeper BINDIR=${BK_HOME}/bin diff --git a/docker/scripts/healthcheck.sh b/docker/scripts/healthcheck.sh index 943be2669c7..503ff950ce3 100755 --- a/docker/scripts/healthcheck.sh +++ b/docker/scripts/healthcheck.sh @@ -24,7 +24,7 @@ set -x -e -u -export JAVA_HOME=/usr/lib/jvm/jre-1.8.0 +export JAVA_HOME=/usr/lib/jvm/jre-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" From 5d45cdc3127db796d83dd5ddbd0fa352feef22db Mon Sep 17 00:00:00 2001 From: Enrico Olivelli Date: Thu, 8 Oct 2020 17:20:32 +0200 Subject: [PATCH 3/4] use JDK11 and not JRE --- docker/Dockerfile | 4 ++-- docker/scripts/entrypoint.sh | 2 +- docker/scripts/healthcheck.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index ae212ca61c6..61d2d4d5157 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -28,12 +28,12 @@ ENV BOOKIE_PORT=3181 EXPOSE $BOOKIE_PORT ENV BK_USER=bookkeeper ENV BK_HOME=/opt/bookkeeper -ENV JAVA_HOME=/usr/lib/jvm/jre-11 +ENV JAVA_HOME=/usr/lib/jvm/jdk-11 # Download Apache Bookkeeper, untar and clean up RUN set -x \ && adduser "${BK_USER}" \ - && yum install -y java-11-openjdk wget bash python sudo\ + && yum install -y java-11-openjdk-devel wget bash python sudo\ && mkdir -pv /opt \ && cd /opt \ && wget -q "${DISTRO_URL}" \ diff --git a/docker/scripts/entrypoint.sh b/docker/scripts/entrypoint.sh index 1cc3c85fcf7..fec1762dc3a 100755 --- a/docker/scripts/entrypoint.sh +++ b/docker/scripts/entrypoint.sh @@ -21,7 +21,7 @@ # */ export PATH=$PATH:/opt/bookkeeper/bin -export JAVA_HOME=/usr/lib/jvm/jre-11 +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 503ff950ce3..70c57e2e76e 100755 --- a/docker/scripts/healthcheck.sh +++ b/docker/scripts/healthcheck.sh @@ -24,7 +24,7 @@ set -x -e -u -export JAVA_HOME=/usr/lib/jvm/jre-11 +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" From c1199d15d85a1285cb2fa8a792584ede0b0a1ae8 Mon Sep 17 00:00:00 2001 From: Enrico Olivelli Date: Thu, 8 Oct 2020 17:22:34 +0200 Subject: [PATCH 4/4] more changes --- docker/README.md | 2 +- docker/docker-compose.yml | 6 +++--- tests/docker-images/current-version-image/Dockerfile | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docker/README.md b/docker/README.md index 5838901eaeb..9d30371cc95 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/jre-11 \ + --env JAVA_HOME=/usr/lib/jvm/jdk-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 f218f460bed..c99787bed20 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -28,7 +28,7 @@ services: links: - zookeeper environment: - - JAVA_HOME=/usr/lib/jvm/jre-11 + - JAVA_HOME=/usr/lib/jvm/jdk-11 - BK_zkServers=zookeeper:2181 - BK_zkLedgersRootPath=/ledgers @@ -38,7 +38,7 @@ services: links: - zookeeper environment: - - JAVA_HOME=/usr/lib/jvm/jre-11 + - JAVA_HOME=/usr/lib/jvm/jdk-11 - BK_zkServers=zookeeper:2181 - BK_zkLedgersRootPath=/ledgers @@ -48,7 +48,7 @@ services: links: - zookeeper environment: - - JAVA_HOME=/usr/lib/jvm/jre-11 + - JAVA_HOME=/usr/lib/jvm/jdk-11 - BK_zkServers=zookeeper:2181 - BK_zkLedgersRootPath=/ledgers diff --git a/tests/docker-images/current-version-image/Dockerfile b/tests/docker-images/current-version-image/Dockerfile index 4a99dd75b63..0eabe772614 100644 --- a/tests/docker-images/current-version-image/Dockerfile +++ b/tests/docker-images/current-version-image/Dockerfile @@ -30,13 +30,13 @@ ENV BOOKIE_GRPC_PORT=4181 EXPOSE ${BOOKIE_PORT} ${BOOKIE_HTTP_PORT} ${BOOKIE_GRPC_PORT} ENV BK_USER=bookkeeper ENV BK_HOME=/opt/bookkeeper -ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11 +ENV JAVA_HOME=/usr/lib/jvm/jdk-11 # prepare utils RUN set -x \ && adduser "${BK_USER}" \ && yum install -y epel-release \ - && yum install -y java-11-openjdk wget bash python-pip python-devel sudo netcat gcc gcc-c++ \ + && yum install -y java-11-openjdk-devel wget bash python-pip python-devel sudo netcat gcc gcc-c++ \ && mkdir -pv /opt \ && cd /opt \ # install zookeeper shell