Skip to content

Commit 8ea476e

Browse files
NickLarsenNZTechassilfrancke
authored
fix: Migrate to temurin JDK/JRE (#894)
* chore: add shell.nix * chore: install find in stackable-base * chore: migrate to temurin jdk/jre * chore: mark niv files as generated * chore: update the changelog * chore: Add link about install instructions Co-authored-by: Nick <[email protected]> * Apply suggestions from code review Co-authored-by: Techassi <[email protected]> * Apply suggestions from code review Co-authored-by: Lars Francke <[email protected]> --------- Co-authored-by: Techassi <[email protected]> Co-authored-by: Lars Francke <[email protected]>
1 parent 3f71aab commit 8ea476e

File tree

13 files changed

+278
-19
lines changed

13 files changed

+278
-19
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nix/** linguist-generated

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ All notable changes to this project will be documented in this file.
2727

2828
- ci: Rename local actions, adjust action inputs and outputs, add definition
2929
README file ([#819]).
30-
- Update cargo-cyclonedx to 0.5.5 and build CycloneDX 1.5 files ([#783])
31-
- Enable [Docker build checks](https://docs.docker.com/build/checks/) ([#872])
30+
- Update cargo-cyclonedx to 0.5.5 and build CycloneDX 1.5 files ([#783]).
31+
- Enable [Docker build checks](https://docs.docker.com/build/checks/) ([#872]).
32+
- java: migrate to temurin jdk/jre ([#894]).
3233

3334
### Removed
3435

@@ -78,6 +79,7 @@ All notable changes to this project will be documented in this file.
7879
[#880]: https://github.com/stackabletech/docker-images/pull/880
7980
[#881]: https://github.com/stackabletech/docker-images/pull/881
8081
[#882]: https://github.com/stackabletech/docker-images/pull/882
82+
[#894]: https://github.com/stackabletech/docker-images/pull/894
8183

8284
## [24.7.0] - 2024-07-24
8385

hive/versions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"jmx_exporter": "1.0.1",
55
# Hive 4 must be built with Java 8 (according to GitHub README) but seems to run on Java 11
66
"java-base": "11",
7-
"java-devel": "1.8.0",
7+
"java-devel": "8",
88
"hadoop": "3.3.6",
99
# Keep consistent with the dependency from Hadoop: https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-aws/3.3.6
1010
"aws_java_sdk_bundle": "1.12.367",
@@ -16,7 +16,7 @@
1616
"jmx_exporter": "1.0.1",
1717
# Hive 3 must be built with Java 8 but will run on Java 11
1818
"java-base": "11",
19-
"java-devel": "1.8.0",
19+
"java-devel": "8",
2020
"hadoop": "3.3.6",
2121
# Keep consistent with the dependency from Hadoop: https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-aws/3.3.6
2222
"aws_java_sdk_bundle": "1.12.367",

java-base/Dockerfile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,20 @@ LABEL name="Stackable image for OpenJDK" \
1717
summary="The Stackable OpenJDK base image." \
1818
description="This image is the base image for all Stackable Java product images."
1919

20-
# We need to use EPEL, as openjdk 22 is not shipped with UBI9
21-
RUN rpm --install --replacepkgs https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
20+
# See: https://adoptium.net/en-gb/installation/linux/#_centosrhelfedora_instructions
21+
RUN cat <<EOF > /etc/yum.repos.d/adoptium.repo
22+
[Adoptium]
23+
name=Adoptium
24+
baseurl=https://packages.adoptium.net/artifactory/rpm/rhel/\$releasever/\$basearch
25+
enabled=1
26+
gpgcheck=1
27+
gpgkey=https://packages.adoptium.net/artifactory/api/gpg/key/public
28+
EOF
2229

2330
RUN microdnf update && \
2431
microdnf install \
25-
# Obviously needed to run Java programs
26-
java-${PRODUCT}-openjdk-headless \
32+
# Needed to run Java programs
33+
"temurin-${PRODUCT}-jre" \
2734
# Needed, because otherwise e.g. Zookeeper fails with
2835
# Caused by: java.io.FileNotFoundException: /usr/lib/jvm/java-11-openjdk-11.0.20.0.8-2.el8.x86_64/lib/tzdb.dat (No such file or directory)
2936
tzdata-java \
@@ -34,7 +41,7 @@ RUN microdnf update && \
3441

3542
COPY java-base/licenses /licenses
3643

37-
ENV JAVA_HOME=/usr/lib/jvm/jre-${PRODUCT}
44+
ENV JAVA_HOME="/usr/lib/jvm/temurin-${PRODUCT}-jre"
3845

3946
# This image doesn't include the development packages for Java.
4047
# For images that need the devel package (ex. Spark) use this env variable to

java-base/versions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
versions = [
22
{
3-
"product": "1.8.0",
3+
"product": "8",
44
"vector": "0.41.1",
55
},
66
{

java-devel/Dockerfile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,15 @@ FROM stackable/image/stackable-base
99

1010
ARG PRODUCT
1111

12-
# We need to use EPEL, as openjdk 22 is not shipped with UBI9
13-
RUN rpm --install --replacepkgs https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
12+
# See: https://adoptium.net/en-gb/installation/linux/#_centosrhelfedora_instructions
13+
RUN cat <<EOF > /etc/yum.repos.d/adoptium.repo
14+
[Adoptium]
15+
name=Adoptium
16+
baseurl=https://packages.adoptium.net/artifactory/rpm/rhel/\$releasever/\$basearch
17+
enabled=1
18+
gpgcheck=1
19+
gpgkey=https://packages.adoptium.net/artifactory/api/gpg/key/public
20+
EOF
1421

1522
RUN microdnf update && \
1623
microdnf install -y \
@@ -27,9 +34,10 @@ RUN microdnf update && \
2734
gettext \
2835
# For the apply_patches.sh script
2936
git \
30-
# needed by the maven ant run plugin for the "set-hostname-property" step in zookeeper
37+
# Needed by the maven ant run plugin for the "set-hostname-property" step in zookeeper
3138
hostname \
32-
java-"${PRODUCT}"-openjdk-devel \
39+
# Needed for compiling Java projects
40+
"temurin-${PRODUCT}-jdk" \
3341
krb5-devel \
3442
libcurl-devel \
3543
make \
@@ -46,7 +54,7 @@ RUN microdnf update && \
4654
microdnf clean all && \
4755
rm -rf /var/cache/yum
4856

49-
ENV JAVA_HOME=/usr/lib/jvm/jre-${PRODUCT}
57+
ENV JAVA_HOME="/usr/lib/jvm/temurin-${PRODUCT}-jdk"
5058

5159
COPY --chown=stackable:0 java-devel/stackable/settings.xml /stackable/.m2/settings.xml
5260

java-devel/versions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
versions = [
22
{
3-
"product": "1.8.0",
3+
"product": "8",
44
"stackable-base": "1.0.0",
55
},
66
{

nix/sources.json

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nix/sources.nix

Lines changed: 198 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

opa/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ ARG BUNDLE_BUILDER_VERSION
99
RUN microdnf update \
1010
&& microdnf install \
1111
cmake \
12-
findutils \
1312
gcc \
1413
gcc-c++ \
1514
git \

0 commit comments

Comments
 (0)