FROM openjdk:8-jre-alpine #镜像的制作人 LABEL MAINTAINER=723557599@qq.com ##定义环境变量RUN mkdir -p /opt/server/ ADD target/ujoined-boot-remote-api-0.0.1-SNAPSHOT.jar /opt/server/app.jar RUN #bash -c 'touch /opt/server/app.jar' #设置环境变量(程序运行时使用) ENV JAR_FILE=app.jar ENV JAVA_PATH=/opt/server ENV JAVA_OPTS="" ENV PARAMS=""##创建Liunx对windows字体库支持 RUN mkdir -p /usr/share/fonts/windows/ ##安装字体 ADD Fonts/* /usr/share/fonts/windows/ RUN chmod 755 /usr/share/fonts/windows/* RUN cd /usr/share/fonts/windows/ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk add --update ttf-dejavu fontconfig && rm -rf /var/cache/apk/* && mkfontscale && mkfontdir && fc-cache ENV TZ=Asia/Shanghai RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone#ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","${JAVA_JAR}"] ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom -jar $JAVA_PATH/$JAR_FILE $PARAMS"]