Dockerfile
FROM tomcat:9.0-jre8-alpine MAINTAINER louguanyang <[email protected]> VOLUME /tmp ARG JAR_FILE RUN apk add -U tzdata RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo "Asia/Shanghai" > /etc/timezone RUN apk del tzdata ADD ${JAR_FILE} /usr/local/tomcat/webapps CMD ["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>
原文地址:https://www.cnblogs.com/louguanyang/p/9589058.html
时间: 2024-10-03 19:12:11