Repeat the answer and your question: you need to replace the lines in the installer file, instead of your last command:
apt-get install -y
run the following commands:
apt-get -y install oracle-java8-installer || true cd /var/lib/dpkg/info sed -i 's|JAVA_VERSION=8u151|JAVA_VERSION=8u162|' oracle-java8-installer.* sed -i 's|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u162-b12/0da788060d494f5095bf8624735fa2f1/|' oracle-java8-installer.* sed -i 's|SHA256SUM_TGZ="c78200ce409367b296ec39be4427f020e2c585470c4eed01021feada576f027f"|SHA256SUM_TGZ="68ec82d47fd9c2b8eb84225b6db398a72008285fafc98631b1ff8d2229680257"|' oracle-java8-installer.* sed -i 's|J_DIR=jdk1.8.0_151|J_DIR=jdk1.8.0_162|' oracle-java8-installer.* apt-get install -f -y apt-get install -y oracle-java8-set-default
I have them in a separate script and run it as
RUN /bin/sh /path/to/script.sh
or you can run them directly from your Docker file, what you need.
source share