您好,登录后才能下订单哦!
密码登录
登录注册
点击 登录注册 即表示同意《亿速云用户服务条款》
本篇内容主要讲解“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进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。