標籤:shang ali timezone webapp art main localtime config Fix
Dockerfile
FROM tomcat:9.0-jre8-alpineMAINTAINER louguanyang <[email protected]>VOLUME /tmpARG JAR_FILERUN apk add -U tzdataRUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtimeRUN echo "Asia/Shanghai" > /etc/timezoneRUN apk del tzdataADD ${JAR_FILE} /usr/local/tomcat/webappsCMD ["catalina.sh", "run"]
pom.xml
<!-- dockerfile-maven-plugin --><plugin> <groupId>com.spotify</groupId> <artifactId>dockerfile-maven-plugin</artifactId> <version>${dockerfile-maven-plugin.version}</version> <executions> <execution> <id>default</id> <phase>package</phase> <goals> <goal>build</goal> <!--<goal>push</goal>--> <!--<goal>tag</goal>--> </goals> </execution> </executions> <configuration> <force>false</force> <repository>${docker.repository}/${docker.image.prefix}/${project.artifactId}</repository> <tag>${project.version}</tag> <buildArgs> <JAR_FILE>target/${project.build.finalName}.war</JAR_FILE> </buildArgs> </configuration></plugin>
Docker中部署Tomcat,並且部署Java應用程式