Docker makes minimal Java mirroring

Source: Internet
Author: User

Premise: Most of the Java images are now based on CentOS and Ubuntu, the result is very large mirror, basically 300-500m, too affect the use of Docker.

Idea: Switching to a more lightweight Linux system, removing irrelevant stuff from the JDK

Download the JDK's tar package first, and then remove extraneous items from the JDK

Unzip the jdk1.6.0_33.tgz to/USR/JAVA/JDK

    rm -rf /usr/java/jdk/*src.zip             /usr/java/jdk/lib/missioncontrol             /usr/java/jdk/lib/visualvm             /usr/java/jdk/lib/*javafx*             /usr/java/jdk/jre/lib/plugin.jar            /usr/ java/jdk/jre/lib/ext/jfxrt.jar            /usr/ java/jdk/jre/bin/javaws            /usr/java/jdk/ Jre/lib/javaws.jar            /usr/java/jdk/jre/ Lib/desktop            /usr/java/jdk/jre/plugin             /usr/java/jdk/jre/lib/deploy*             /usr/java/jdk/jre/lib/*javafx*             /usr/java/jdk/jre/lib/*jfx*             /usr/java/jdk/jre/lib/amd64/libdecora_sse.so             /usr/java/jdk/jre/lib/amd64/libprism_*.so             /usr/java/jdk/jre/lib/amd64/libfxplugins.so             /usr/java/jdk/jre/lib/amd64/libglass.so             /usr/java/jdk/jre/lib/amd64/libgstreamer-lite.so             /usr/java/jdk/jre/lib/amd64/libjavafx*.so              /usr/java/jdk/jre/lib/amd64/libjfx*.so 

The following dockerfile are based on Alpinelinux

#Alpine Linux with a glibc-2.21 and Oracle Java 7FROM docker.io/jeanblanchard/alpine-glibc#maintainer Fox Chan#java versio N#env java_version_major 7#env java_version_minor 60#env java_package jdk#install javaADD jdk/usr/java/jdk# Set ENV Ironmentenv java_home/usr/java/jdkenv PATH ${path}:${java_home}/bin

Just 158.3 MB, it's cool!

This article is from the "Silver Fox" blog, please be sure to keep this source http://foxhound.blog.51cto.com/1167932/1725221

Docker makes minimal Java mirroring

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: info-contact@alibabacloud.com 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.