Install java with Ubuntu 16.04 based Docker

Install java with Ubuntu 16.04 based Docker

Install JDK 8

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

Install JDK 8 (using mirror site with apt)

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

Install java with Ubuntu 16.04 based Docker
Install java with Homebrew
Install Java with Ansible
Install Gradle with ubuntu16.04
Install Composer with Docker
Install OpenJDK7 (JAVA) on ubuntu 14.04
Install Java 7 with Homebrew (cask)
Install Docker on Ubuntu Server 20.04
Oracle Java 8 on Docker Ubuntu
Install Java on WSL Ubuntu 18.04
Install Java and Tomcat with Ansible
Install Java with zip on Windows
Easily Docker Java applications with Jib
Install ruby on Ubuntu 20.04 with rbenv
Install OpenJDK (Java) on the latest Ubuntu
Install Docker Desktop for Mac with Homebrew
Environment construction with Docker (Ubuntu20.04) + Laravel + nginx
Introduced vscode with apt to docker: ubuntu
Install Java8 with Yum on Amazon Linux
Build OpenCV with Java Wrapper on Ubuntu 18.04
Install Docker with WSL2 Memo ([Part 2] Docker introduction)
Run Ubuntu + ROS with Docker on Mac
Install Docker and create Java runtime environment
/ n \ n docker java
Make SpringBoot1.5 + Gradle4.4 + Java8 + Docker environment compatible with Java11
Install Java 11 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
I couldn't install docker with raspberry pi2 b +.
Install Java 14 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
Install Java 8 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
Prepare a scraping environment with Docker and Java
Docker Container Operations with Docker-Client API for Java
Build mecab (NEologd dictionary) environment with Docker (ubuntu)
Switch versions with alternatives after yum install java
Install Ruby 3.0.0 with asdf
Install Java on Mac
Change seats with java
Bundle install with docker + rails6 does not reflect gem
[Java] Install Amazon Corretto 8
Install OpenJDK8 with RPM
Install pyqt5 on ubuntu
Launch MariaDB with Docker
Install ROS Noetic ubuntu20.04
Rails deploy with Docker
Run Pico with docker
Explode Docker with WSL2
Install Java 8 (OpenJDK: Amazon Corretto) on macOS with Homebrew
Install Docker on Manjaro
Use Puphpeteer with Docker
Comfortable download with JAVA
Install Ruby on Ubuntu 20.04
How to install Docker
Switch java with direnv
Operate Emby with Docker
Command memo to install xeyes in ubuntu docker environment
Try WildFly with Docker
Use ngrok with Docker
Install Java 8 (OpenJDK: Zulu Community) on macOS with Homebrew
Run Payara with Docker
[Note] Create a java environment from scratch with docker
Install Autoware on Ubuntu 18.04.5
(For myself) Build gitlab with ubuntu18.04 + docker for home (Note)