Skip to content

Instantly share code, notes, and snippets.

@dhval
Created December 20, 2015 20:48
Show Gist options
  • Save dhval/706f98774f59bc9db739 to your computer and use it in GitHub Desktop.
Save dhval/706f98774f59bc9db739 to your computer and use it in GitHub Desktop.
Java Docker Template
From ubuntu
MAINTAINER Dhval Mudawal
RUN apt-get update && apt-get --ignore-missing install -y \
build-essential \
lsof \
git \
wget \
software-properties-common \
&& apt-get clean
# Install Java.
RUN \
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
add-apt-repository -y ppa:webupd8team/java && \
apt-get update && \
apt-get install -y oracle-java8-installer && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/oracle-jdk8-installer
# Define working directory.
WORKDIR /project
# Define commonly used JAVA_HOME variable
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
# Define default command.
CMD ["bash"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment