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</ph Ase> <goals> <goal>build</goal> <!--<goal>push</ goal>--> <!--<goal>tag</goal>--> </goals> </execution> ; </executions> <configuration> <force>false</force> <repository>${docker.rep Ository}/${docker.image.prefix}/${project.artifactid}</repository> <tag>${project.version}</tag > <buildArgs> <JAR_FILE>target/${project.build.finalName}.war</JAR_FILE> < ;/buildargs> </configuraTion></plugin>
Deploying Tomcat in Docker and deploying Java applications