网上很多文件,java都不是很全,我从网上搜了一下,其中java包还能减小,我因为不熟,所以全部都放进去了,后期再优化。
FROM docker.io/jeanblanchard/alpine-glibc
MAINTAINER wangzt
ADD server-jre-8u202-linux-x64.tar.gz /usr/local # 添加java包
ADD locale-archive /usr/glibc-compat/lib/locale/locale-archive # 添加中文
ENV LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 JAVA_HOME=/usr/local/jdk1.8.0_202
PATH=$PATH:/usr/local/jdk1.8.0_202/bin
RUN echo "Asia/Shanghai" > /etc/timezone # 设置中文
&& alpine_version=`cat /etc/issue | head -1 | awk '{print $5}'`
&& echo "https://mirrors.aliyun.com/alpine/v${alpine_version}/main/" > /etc/apk/repositories # 修改apk源为阿里云
&& apk upgrade && apk add --no-cache bash bash-doc bash-completion
&& rm -rf /var/cache/apk/*
WORKDIR /app/
locale-archive文件网盘地址:链接:https://pan.baidu.com/s/1_ipxdeHUqifAuQzYVcBqvA 密码:lyvv