Skip to content

Instantly share code, notes, and snippets.

@barata0
Created November 5, 2013 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barata0/7325448 to your computer and use it in GitHub Desktop.
Save barata0/7325448 to your computer and use it in GitHub Desktop.
lxc-docker ubuntu oracle-java7-jdk
#
#Oracle JDK installation
#
FROM ubuntu:precise
MAINTAINER Daniel Ribeiro <danieltribeiro@gmail.com>
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update && apt-get -y install python-software-properties
RUN add-apt-repository ppa:webupd8team/java
RUN apt-get update && apt-get -y upgrade
# automatically accept oracle license
RUN echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
# and install java 7 oracle jdk
RUN apt-get -y install oracle-java7-installer && apt-get clean
RUN update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/java-7-oracle/bin/java" 1
RUN update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/java-7-oracle/bin/javac" 1
RUN update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/java-7-oracle/bin/javaws" 1
# set JAVA_HOME env var
ENV JAVA_HOME /usr/lib/jvm/java-7-oracle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment