作者 朱兆平

docker 部署自动化

1 FROM java:8u111 1 FROM java:8u111
2 VOLUME /tmp 2 VOLUME /tmp
3 3
4 -ENV PINPOINT_VERSION="2.3.1"  
5 -ENV AGENT_ID="gateway-Utf8-master1.0"  
6 -ENV APP_NAME="gateway-Utf8"  
7 -ENV JAVA_OPTS="-javaagent:/pinpoint-agent/pinpoint-bootstrap-${PINPOINT_VERSION}.jar -Dpinpoint.agentId=${AGENT_ID} -Dpinpoint.applicationName=${APP_NAME} -Dspring.profiles.active=${SPRING_PROFILES}" 4 +#ENV PINPOINT_VERSION="2.3.1"
  5 +#ENV AGENT_ID="gateway-Utf8-master1.0"
  6 +#ENV APP_NAME="gateway-Utf8"
  7 +#ENV JAVA_OPTS="-javaagent:/pinpoint-agent/pinpoint-bootstrap-${PINPOINT_VERSION}.jar -Dpinpoint.agentId=${AGENT_ID} -Dpinpoint.applicationName=${APP_NAME} -Dspring.profiles.active=${SPRING_PROFILES}"
8 8
9 ADD *.jar app.jar 9 ADD *.jar app.jar
10 EXPOSE 12343 10 EXPOSE 12343
11 RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 11 RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
12 RUN echo "Asia/Shanghai" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata 12 RUN echo "Asia/Shanghai" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
13 #ENTRYPOINT ["java","$JAVA_OPTS","-jar","/app.jar"] 13 #ENTRYPOINT ["java","$JAVA_OPTS","-jar","/app.jar"]
14 -ENTRYPOINT java $JAVA_OPTS -jar /app.jar 14 +ENTRYPOINT java -jar /app.jar
15 # Ubuntu 时区 15 # Ubuntu 时区
16 16