#glibc安装包如果从网络下载速度实在是太慢了,先提前下载复制到镜像中
COPY glibc-2.29-r0.apk /usr/local/java/
COPY glibc-bin-2.29-r0.apk /usr/local/java/
COPY glibc-i18n-2.29-r0.apk /usr/local/java/
COPY msg.jar /usr/local/java/
#更新Alpine的软件源为阿里云,因为从默认官源拉取实在太慢了
RUN echo http://mirrors.aliyun.com/alpine/v3.10/main/ > /etc/apk/repositories && \
echo http://mirrors.aliyun.com/alpine/v3.10/community/ >> /etc/apk/repositories
RUN apk update && apk upgrade
#运行指定的命令
#Alpine linux为了精简本身并没有安装太多的常用软件,apk类似于ubuntu的apt-get,
#用来安装一些常用软V件,其语法如下:apk add bash wget curl git make vim docker
#wget是linux下的ftp/http传输工具,没安装会报错“/bin/sh: wget: not found”,网上例子少安装wget
#ca-certificates证书服务,是安装glibc前置依赖
RUN apk --no-cache add ca-certificates wget \
&& wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
&& apk add glibc-2.29-r0.apk glibc-bin-2.29-r0.apk glibc-i18n-2.29-r0.apk \
&& rm -rf /var/cache/apk/* glibc-2.29-r0.apk glibc-bin-2.29-r0.apk glibc-i18n-2.29-r0.apk
#配置环境变量
ENV JAVA_HOME=/usr/local/java/jre1.8.0_221
ENV CLASSPATH=.: J A V A H O M E / l i b / d t . j a r : JAVA_HOME/lib/dt.jar: JAVAHOME/lib/dt.jar:JAVA_HOME/lib/tools.jar
ENV PATH= J A