docker mirror (Ubuntu) installed jdk

1. Find a clean Ubuntu
Docker Search Ubuntu
docker mirror (Ubuntu) installed jdk
2, download the image
Docker pull Ubuntu
docker mirror (Ubuntu) installed jdk
3, edit the file dockerfile
======================== file contents start == ==============================
the FROM Ubuntu: Latest
the MAINTAINER on Prosect
the ADD-8u211 JDK-Linux-x64.tar.gz / usr / local /
ENV JAVA_HOME /usr/local/jdk1.8.0_211
ENV the CLASSPATH $ JAVA_HOME / lib / dt.jar: $ JAVA_HOME / lib / tools.jar
ENV the PATH $ the PATH: $ JAVA_HOME / bin
======== ================ file contents end =============================== =
4, the compiler generates the image file
Docker Build -t-8u211 the JDK:. 20,190,528 -f jdk18_211dockerfile
docker mirror (Ubuntu) installed jdk
5, to view mirror
Docker PS
docker mirror (Ubuntu) installed jdk
6, mirroring run created
Docker rUN -d -it the JDK-8u211: 20,190,528 / bin / bash
docker mirror (Ubuntu) installed jdk
7, enter mirror, see jdk installed correctly
Exec -it f0a69e432aa8 Docker / bin / bash
docker mirror (Ubuntu) installed jdk
8, view the version number jdk
java -version
docker mirror (Ubuntu) installed jdk

Guess you like

Origin blog.51cto.com/709151/2401328