-
Notifications
You must be signed in to change notification settings - Fork 274
Description
I'm using Splunk's Docker image for developing DBConnect solutions. This requires Java.
In images up through the current 7.2.6 image d0e924f35601, I've been able to install java 1.8 using the following command as root in a Splunk Enterprise container:
apt update && mkdir -p /usr/share/man/man1 && apt install default-jre -y && java -version
As of the 7.3 image e92c2081a504, this no longer works. Neither does workarounds such as:
apt install software-properties-common -y && add-apt-repository ppa:openjdk-r/ppa && apt-get install openjdk-8-jre
Notice I'm trying OpenJDK, not Oracle Java. Although I couldn't get either to install.
Steps to reproduce:
- Create a new docker image. Use either
splunk:splunk/latestorsplunk/splunk:7.2.6:docker run --name java --hostname java -P -d -e SPLUNK_START_ARGS=--accept-license -e SPLUNK_PASSWORD=changeme splunk/splunk:latest - Connect to terminal:
docker exec -it java /bin/bash - Switch to root:
sudo su - - Install Java:
apt update && mkdir -p /usr/share/man/man1 && apt install openjdk-8-jre -y && java -version && sudo su - splunk -c "/opt/splunk/bin/splunk restart". In the 7.2.6 image,default-jreinstalls Java 1.8. In the 7.3 image, it installs Java 11. So usingopenjdk-8-jre
On the 7.2.6 image, the installation works:
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-8u212-b03-2~deb9u1-b03)
OpenJDK 64-Bit Server VM (build 25.212-b03, mixed mode)
On the 7.3 image you'll now get the error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
18 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package openjdk-8-jre
Conversely, installing with default-jre installs Java 11 but such is incompatible with DBConnect and throws an error such that the DBConnect java task server won't start.
I've also tried apt install software-properties-common -y && add-apt-repository ppa:openjdk-r/ppa to no success.