Last active
December 21, 2022 17:23
-
-
Save timohuovinen/f5527f87975fbb80035dc177e0ca6f1c to your computer and use it in GitHub Desktop.
Install java 8 (2022 Oct 12) on Docker with linux amd64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARG JRE_URL=http://javadl.oracle.com/webapps/download/AutoDL?BundleId=247127_10e8cce67c7843478f41411b7003171c | |
ARG JAVA_HOME_NAME=java-8-oracle | |
RUN \ | |
apt-get update && \ | |
apt-get install -y wget && \ | |
wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" $JRE_URL -O java-linux-x64.tar.gz && \ | |
mkdir -p /usr/lib/jvm/$JAVA_HOME_NAME && \ | |
tar -C /usr/lib/jvm/$JAVA_HOME_NAME --strip-components=1 -xvf java-linux-x64.tar.gz && \ | |
update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/$JAVA_HOME_NAME/bin/java" 1 && \ | |
rm -rf /var/lib/apt/lists/* && \ | |
rm *linux-x64.tar.gz | |
ENV JAVA_HOME /usr/lib/jvm/$JAVA_HOME_NAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment