基于tini的openjdk8镜像
FROM openjdk:8-jdk-alpine #jdk采用openjdk8,操作系统采用alpine,减小体积 RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories #修改镜像源为阿里源 ENV LANG=en_US.UTF-8 RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' >/etc/timezone #修改时区及默认字符集 RUN apk add --update --no-cache ttf-dejavu fontconfig busybox-extras iproute2 curl net-tools tcpdump wget&& \ apk --update --no-cache add tini && \ rm -rf /var/cache/apk/* #添加常用工具及字符集字体等 #采用tini运行java,提高运行可靠性,防止僵尸进程,并且方便适应jdk自带命令 #***.jar 替换为需要运行的jar ENTRYPOINT tini java $JAVA_OPTS -jar /***.jar
生产环境基于tini的openjdk8镜像
#FROM fiadliel/java8-jre #jdk采用openjdk8,操作系统采用alpine,减小体积 FROM openjdk:8-jdk-alpine #修改镜像源为阿里源 RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories #修改时区及默认字符集 ENV LANG=en_US.UTF-8 VOLUME /tmp ADD play-api-*.jar play-api-3.0.0-release.jar RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' >/etc/timezone #添加常用工具及字符集字体等 #采用tini运行java,提高运行可靠性,防止僵尸进程,并且方便适应jdk自带命令 RUN apk add --update --no-cache ttf-dejavu fontconfig busybox-extras iproute2 curl net-tools tcpdump wget&& \ apk --update --no-cache add tini && \ rm -rf /var/cache/apk/* ENTRYPOINT ["tini","java","-Djava.security.egd=file:/dev/./urandom","-jar","/play-api-3.0.0-release.jar"]
标签:RUN,--,cache,jar,apk,openjdk8,镜像,tini From: https://www.cnblogs.com/linjiqin/p/17689904.html