FROM ubuntu:16.04
ENV JAVA_HOME=/usr/lib/jvm/java-8-oracle \
DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y software-properties-common wget && \
add-apt-repository -y ppa:webupd8team/java && \
apt-get upgrade -y && \
apt-get update && \
echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 boolean true" | debconf-set-selections && \
apt-get install -y oracle-java8-set-default && \
apt-get clean
If there are other packages you need, add them before the last line "apt-get clean". Always forget the echo line.
Recommended Posts