Skip to content

Instantly share code, notes, and snippets.

@stantonk
Created May 7, 2017 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stantonk/50b42f59b5f0d48b3d925d53916651d1 to your computer and use it in GitHub Desktop.
Save stantonk/50b42f59b5f0d48b3d925d53916651d1 to your computer and use it in GitHub Desktop.
barebones Docker base image w/ Oracle JVM
FROM ubuntu:16.04
# Install Java8
# Presumes you have downloaded / accepted the license file from Oracle's website.
# https://www.digitalocean.com/community/tutorials/how-to-manually-install-oracle-java-on-a-debian-or-ubuntu-vps
RUN mkdir /opt/jdk
COPY ./jdk-8u112-linux-x64.tar.gz /tmp/
RUN tar -zxvf /tmp/jdk-8u112-linux-x64.tar.gz -C /opt/jdk
RUN update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_112/bin/java 100
RUN update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_112/bin/javac 100
RUN java -version
# always clean up after yourself in docker images to keep their size down!
RUN rm /tmp/jdk-8u112-linux-x64.tar.gz
# include any potentially needed packages
RUN apt-get update && apt-get install -y \
wget \
&& rm -rf /var/lib/apt/lists/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment