FROM openjdk:8-jre RUN mkdir /app # 复制jar文件到路径 ADD *.jar /app/app.jar RUN bash -c 'touch /app/app.jar' WORKDIR /app # EXPOSE 80 # 时区调整 RUN bash -c 'cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone' RUN bash -c 'sed -i "1,$ s/ TLSv1, TLSv1.1,//g" /usr/local/openjdk-8/lib/security/java.security' # RUN ["apt-get", "update"] #RUN apt-get install -y curl # 此处命令为启动容器 # java -Djava.security.egd=file:/dev/./urandom -jar /app/app.jar # "-Djava.security.egd=file:/dev/./urandom"java参数,可靠的产生随机数,此处目的是加快系统启动,如果存在tomcat建议使用此参数 # ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app/app.jar"]