I am used to download java in my dockerfile like this :
# Install Java
ENV JAVA_VERSION_MAJOR 8
ENV JAVA_VERSION_MINOR 162
ENV JAVA_VERSION_BUILD 12
ENV JAVA_DOWNLOAD_HASH 0da788060d494f5095bf8624735fa2f1
RUN mkdir -p /usr/lib/jvm \
&& cd /usr/lib/jvm \
&& wget -nv --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-b${JAVA_VERSION_BUILD}/${JAVA_DOWNLOAD_HASH}/jdk-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.tar.gz \
&& tar xf jdk-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.tar.gz \
&& rm jdk-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.tar.gz \
&& update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.${JAVA_VERSION_MAJOR}.0_${JAVA_VERSION_MINOR}/bin/java" 1
ENV JAVA_HOME /usr/lib/jvm/jdk1.${JAVA_VERSION_MAJOR}.0_${JAVA_VERSION_MINOR}
Apparently, oracle has released new update 8u172 and download within dockerfile is failing with ERROR 404: Not Found.
My question is , how do I find out JAVA_DOWNLOAD_HASH
variable ?
Rest of variable values are clear to me :
JAVA_VERSION_MAJOR 8
JAVA_VERSION_MINOR 172
JAVA_VERSION_BUILD 11
Please note that my base docker image is : ubuntu:16.04
My installation of java within ubuntu is inspired from here