This is a creation in Article, where the information may have evolved or changed.
The text of this text connection is: http://blog.csdn.net/freewebsys/article/details/53744348 not allowed to reprint without the Bo master.
Bo main address is: Http://blog.csdn.net/freewebsys
1, about the Java environment
If you use the official Docker Java environment, it will be very large 643.2 MB.
And there's a lot of useless stuff in there. Not very good.
Find an easy way to install directly using OPENJRE.
Installing the Oracle JRE under Alpinelinux will find no glibc libraries.
and Alpine does not provide the installation of this library, web search can be downloaded,
But the site is not accessible.
It's always impossible.
It's not as easy as openjdk. 106.3 MB.
2,dockerfile
Dockerfile is very simple.
Https://pkgs.alpinelinux.org/package/v3.4/community/x86_64/openjdk8-jre-base
The official source from Alpine is downloaded and installed, but this is a community release.
The address of the community needs to be introduced.
# AlpineLinux open jre 8FROM alpine:latest# Install cURLecho-e"https://mirror.tuna.tsinghua.edu.cn/alpine/v3.4/main\n\https://mirror.tuna.tsinghua.edu.cn/alpine/v3.4/community" > /etc/apk/repositoriesRUN apk --update add curl bash openjdk8-jre-base && \ rm -rf /var/cache/apk/*# Set environment${PATH}:${JAVA_HOME}/bin
Introduce the community image, use the domestic address, download fast. Installing Curl Bash makes it easy to log in to your system.
The last JRE environment is 106 MB, very small. Very good.
-t demo/openjre8-base:1.0.
3, run
docker run --rm -it demo/alpine-openjre8-base:1.0 bash bash-4.3# java -version"1.8.0_111-internal"1.8.0_111-internalVM (build 25.111-b14, mixed mode)
Version of OPENJDK 1.8 used
If you want to install the JDK environment. Modify the APK add openjdk8 directly.
The name is called Openjdk8 not with jdkxxx what. The JRE is special.
4, summary
The text of this text connection is: http://blog.csdn.net/freewebsys/article/details/53744348 not allowed to reprint without the Bo master.
Bo main address is: Http://blog.csdn.net/freewebsys
Java is compiled on top of Jenkins, and the Java Runtime Environment includes only the JRE.
Run with a openjdk of 1.8. All Jenkins also compiles using the 1.8 openjdk.
It's much smaller than Oracle's JDKOPENJDK, and it's much leaner than other bundled things like JavaFX.
OpenJDK is very good and takes up less disk space.