Skip to content

Commit

Permalink
Update to OpenJDK11 in Docker image
Browse files Browse the repository at this point in the history
Descriptions of the changes in this PR:
- Update "master" docker image to BK 4.11.0
- Update to OpenJDK11 the main Docker image and the Docker image used for integration tests
- We are not using "JRE" because it does not bundle jshell and our script detects the presence of JDK11+ from the presence of file "jshell"

Master Issue: #2387


Reviewers: Ravi Sharda <None>, Jia Zhai <zhaijia@apache.org>

This closes #2433 from eolivelli/fix/test-jdk11-upgrade-docker
  • Loading branch information
eolivelli committed Oct 16, 2020
1 parent d3af27e commit 83dec6e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
9 changes: 5 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@
FROM centos:7
MAINTAINER Apache BookKeeper <dev@bookkeeper.apache.org>

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

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/jdk-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-devel wget bash python sudo\
&& mkdir -pv /opt \
&& cd /opt \
&& wget -q "${DISTRO_URL}" \
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/jdk-11 \
--entrypoint "/bin/bash" \
apache/bookkeeper \
-c "/opt/bookkeeper/bin/bookkeeper localbookie 3"
Expand Down
6 changes: 3 additions & 3 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
links:
- zookeeper
environment:
- JAVA_HOME=/usr/lib/jvm/jre-1.8.0
- JAVA_HOME=/usr/lib/jvm/jdk-11
- BK_zkServers=zookeeper:2181
- BK_zkLedgersRootPath=/ledgers

Expand All @@ -38,7 +38,7 @@ services:
links:
- zookeeper
environment:
- JAVA_HOME=/usr/lib/jvm/jre-1.8.0
- JAVA_HOME=/usr/lib/jvm/jdk-11
- BK_zkServers=zookeeper:2181
- BK_zkLedgersRootPath=/ledgers

Expand All @@ -48,7 +48,7 @@ services:
links:
- zookeeper
environment:
- JAVA_HOME=/usr/lib/jvm/jre-1.8.0
- JAVA_HOME=/usr/lib/jvm/jdk-11
- BK_zkServers=zookeeper:2181
- BK_zkLedgersRootPath=/ledgers

Expand Down
2 changes: 1 addition & 1 deletion docker/scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/jdk-11

BK_HOME=/opt/bookkeeper
BINDIR=${BK_HOME}/bin
Expand Down
2 changes: 1 addition & 1 deletion docker/scripts/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

set -x -e -u

export JAVA_HOME=/usr/lib/jvm/jre-1.8.0
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"
Expand Down
4 changes: 2 additions & 2 deletions tests/docker-images/current-version-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/jdk-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-devel wget bash python-pip python-devel sudo netcat gcc gcc-c++ \
&& mkdir -pv /opt \
&& cd /opt \
# install zookeeper shell
Expand Down

0 comments on commit 83dec6e

Please sign in to comment.