Docker (one): Alpinelinux installation Openjre

Source: Internet
Author: User
Tags docker run
This is a creation in Article, where the information may have evolved or changed.

The text of this text connection is: not allowed to reprint without the Bo master.
Bo main address is: Http://

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.


Dockerfile is very simple.
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"\n\" > /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: not allowed to reprint without the Bo master.
Bo main address is: Http://
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.