您好,登錄后才能下訂單哦!
本篇內容主要講解“alpine_glibc構建sun jdk 8的docker鏡像的方法”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學習“alpine_glibc構建sun jdk 8的docker鏡像的方法”吧!
alpine glibc 的Dockerfile內容如下:
alpine:3.6 MAINTAINER tongqiang<tongqiangyin@gmail.com> # 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
構建基礎鏡像
docker build -it myimage/alpine_glibc:3.6 .
alpine glibc jdk 8的Dockerfile內容如下:
FROM myimage/alpine_glibc:3.6 MAINTAINER "tongqiang<tongqiangyin@gmail.com>" 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/*
構建sun jdk 8鏡像
docker build -it myimage/alpine_glibc_jdk:8 .
到此,相信大家對“alpine_glibc構建sun jdk 8的docker鏡像的方法”有了更深的了解,不妨來實際操作一番吧!這里是億速云網站,更多相關內容可以進入相關頻道進行查詢,關注我們,繼續學習!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。