Skip to content

Instantly share code, notes, and snippets.

@gkhays
Last active February 3, 2018 03:24
Show Gist options
  • Save gkhays/7239faeecd6a8d45f356a0a36e021bcd to your computer and use it in GitHub Desktop.
Save gkhays/7239faeecd6a8d45f356a0a36e021bcd to your computer and use it in GitHub Desktop.

I got all this working in a Dockerfile; see https://github.com/gkhays/dockerfiles/tree/master/oraclejdk8.

Create an Oracle JDK Docker Image

jdk-8u161-linux-x64.tar.gz

wget --no-cookies --no-check-certificate \
  && --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \
  && "http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-x64.tar.gz"

https://tecadmin.net/install-java-8-on-centos-rhel-and-fedora/#

FROM ubuntu:latest

RUN apt-get update \
   && apt-get install -y wget \
   && rm -rf /var/lib/apt/lists/*

RUN JAVA_TGZ_FILE=jdk-8u161-linux-x64.tar.gz \
  && cd $JAVA_HOME \
  && tar -xvf $JAVA_TGZ_FILE --strip-components=1 \
  && rm $JAVA_TGZ_FILE src.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment