本篇內(nèi)容主要講解“alpine_glibc構(gòu)建sun jdk 8的docker鏡像的方法”,感興趣的朋友不妨來(lái)看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強(qiáng)。下面就讓小編來(lái)帶大家學(xué)習(xí)“alpine_glibc構(gòu)建sun jdk 8的docker鏡像的方法”吧!
10年積累的成都網(wǎng)站設(shè)計(jì)、成都網(wǎng)站建設(shè)、外貿(mào)網(wǎng)站建設(shè)經(jīng)驗(yàn),可以快速應(yīng)對(duì)客戶對(duì)網(wǎng)站的新想法和需求。提供各種問(wèn)題對(duì)應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識(shí)你,你也不認(rèn)識(shí)我。但先網(wǎng)站設(shè)計(jì)后付款的網(wǎng)站建設(shè)流程,更有鎮(zhèn)平免費(fèi)網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。
alpine glibc 的Dockerfile內(nèi)容如下:
alpine:3.6 MAINTAINER 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/download ENV ALPINE_GLIBC_PACKAGE_VERSION 2.25-r0 ENV ALPINE_GLIBC_BASE_PACKAGE_FILENAME glibc-$ALPINE_GLIBC_PACKAGE_VERSION.apk ENV ALPINE_GLIBC_BIN_PACKAGE_FILENAME glibc-bin-$ALPINE_GLIBC_PACKAGE_VERSION.apk ENV ALPINE_GLIBC_I18N_PACKAGE_FILENAME glibc-i18n-$ALPINE_GLIBC_PACKAGE_VERSION.apk RUN 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
構(gòu)建基礎(chǔ)鏡像
docker build -it myimage/alpine_glibc:3.6 .
alpine glibc jdk 8的Dockerfile內(nèi)容如下:
FROM myimage/alpine_glibc:3.6 MAINTAINER "tongqiang" ENV JAVA_VERSION 8 ENV JAVA_UPDATE 151 ENV JAVA_BUILD 12 ENV JAVA_PATH e758a0de34e24606bca991d704f6dcbf ENV JAVA_HOME /usr/local/jvm/default-jvm ENV 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}.zip RUN 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/*
構(gòu)建sun jdk 8鏡像
docker build -it myimage/alpine_glibc_jdk:8 .
到此,相信大家對(duì)“alpine_glibc構(gòu)建sun jdk 8的docker鏡像的方法”有了更深的了解,不妨來(lái)實(shí)際操作一番吧!這里是創(chuàng)新互聯(lián)網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!