Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of constructing docker Image of sun jdk 8 by alpine_glibc

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article focuses on "alpine_glibc 's method of building a docker image of sun jdk 8". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "alpine_glibc 's method of building a docker image of sun jdk 8".

Build a system basic image

The Dockerfile content of alpine glibc is as follows:

Alpine:3.6MAINTAINER tongqiang# Here we install GNU libc (aka glibc) and set C.UTF-8 locale as default.ENV ALPINE_GLIBC_BASE_URL https://github.com/sgerrand/alpine-pkg-glibc/releases/downloadENV ALPINE_GLIBC_PACKAGE_VERSION 2.25-r0ENV ALPINE_GLIBC_BASE_PACKAGE_FILENAME glibc-$ALPINE_GLIBC_PACKAGE_VERSION.apkENV ALPINE_GLIBC_BIN_PACKAGE_FILENAME glibc-bin-$ALPINE_GLIBC_PACKAGE_VERSION.apkENV ALPINE_GLIBC_I18N_PACKAGE_FILENAME glibc-i18n -$ALPINE_GLIBC_PACKAGE_VERSION.apkRUN apk add-- no-cache-- virtual=.build-dependencies wget ca-certificates\ & & wget\ "https://raw.githubusercontent.com/andyshinn/alpine-pkg-glibc/master/sgerrand.rsa.pub"\-O" / etc/apk/keys/sgerrand.rsa.pub "\ & & wget\" $ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC _ BASE_PACKAGE_FILENAME "\" $ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME "\" $ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME "\ & & apk add-- no-cache\" $ALPINE_GLIBC_BASE_PACKAGE_FILENAME "\" $ALPINE_GLIBC_BIN_PACKAGE_FILENAME " \ "$ALPINE_GLIBC_I18N_PACKAGE_FILENAME"\ & & rm "/ etc/apk/keys/sgerrand.rsa.pub"\ & & / usr/glibc-compat/bin/localedef-- force-- inputfile POSIX-- charmap UTF-8 C.UTF-8 | | true\ & & echo "export LANG=C.UTF-8" > / etc/profile.d/locale.sh\ & & apk del glibc-i18n\ & & rm "/ root/. Wget-hsts "& & apk del. Build-dependencies\ & & rm\" $ALPINE_GLIBC_BASE_PACKAGE_FILENAME "\" $ALPINE_GLIBC_BIN_PACKAGE_FILENAME "\" $ALPINE_GLIBC_I18N_PACKAGE_FILENAME "ENV LANG=C.UTF-8

Build a basic image

Docker build-it myimage/alpine_glibc:3.6. Build a sun jdk 8 image on the base image

The Dockerfile content of alpine glibc jdk 8 is as follows:

FROM myimage/alpine_glibc:3.6 MAINTAINER "tongqiang" ENV JAVA_VERSION 8ENV JAVA_UPDATE 151ENV JAVA_BUILD 12ENV JAVA_PATH e758a0de34e24606bca991d704f6dcbf ENV JAVA_HOME / usr/local/jvm/default-jvmENV JAVA_DOWNLOAD_URL http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION}u${JAVA_UPDATE}-b${JAVA_BUILD}/${JAVA_PATH}/jdk-${JAVA_VERSION}u${JAVA_UPDATE}-linux-x64.tar.gz ENV JCE_ DOWNLOAD_URL http://download.oracle.com/otn-pub/java/jce/${JAVA_VERSION}/jce_policy-${JAVA_VERSION}.zipRUN apk add-- no-cache bash tar wget ca-certificates unzip\ & & mkdir-p ${JAVA_HOME}\ & & wget-- header "Cookie: oraclelicense=accept-securebackup-cookie "${JAVA_DOWNLOAD_URL}\ & & tar-xzf jdk-$ {JAVA_VERSION} u ${JAVA_UPDATE}-linux-x64.tar.gz-C ${JAVA_HOME}-- strip-components=1\ & & wget-- header" Cookie: oraclelicense=accept-securebackup-cookie "${JCE_DOWNLOAD_URL}\ & & unzip-jo-d ${JAVA_HOME} / jre/lib/security jce_policy-$ {JAVA_VERSION} .zip\ & & ln-s ${JAVA_HOME} / bin/* / usr/bin/\ & & apk del tar wget ca-certificates unzip\ & & rm-rf jdk-$ {JAVA_VERSION} u ${JAVA_UPDATE}-linux-x64.tar.gz\ ${JAVA_HOME} / * src.zip\ ${JAVA_HOME} / jre/lib/security/README.txt\ jce_policy-$ {JAVA_VERSION} .zip\ / tmp/*

Build a sun jdk 8 image

Docker build-it myimage/alpine_glibc_jdk:8. At this point, I believe you have a deeper understanding of "alpine_glibc 's method of building a docker image of sun jdk 8". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report