Create and build the following Dockerfile.
FROM ubuntu:16.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -y \
&& apt-get install -y software-properties-common \
&& add-apt-repository ppa:openjdk-r/ppa \
&& apt-get install -y openjdk-8-jdk \
&& rm -rf /var/lib/apt/lists/*
# java
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
Change the source of ubuntu apt to mirror on the command line (take2) Use the mirror site setting method described in the article. In the case, it becomes the following Dockerfile.
FROM ubuntu:16.04
ENV DEBIAN_FRONTEND noninteractive
RUN sed -i.bak -r 's!(deb|deb-src) \S+!\1 mirror://mirrors.ubuntu.com/mirrors.txt!' /etc/apt/sources.list \
&& apt-get update -y \
&& apt-get install -y software-properties-common \
&& add-apt-repository ppa:openjdk-r/ppa \
&& apt-get install -y openjdk-8-jdk \
&& rm -rf /var/lib/apt/lists/*
# java
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
https://gist.github.com/m-tmatma/1bebb33ab2ed47e7c00385e2d87fbd27
reference https://kazuhira-r.hatenablog.com/entry/2019/03/10/225459 https://openjdk.java.net/install/
Recommended Posts