Last active
July 25, 2019 03:23
-
-
Save steventong/800d2cdf93d5523f50a2d6e3f2d4810a to your computer and use it in GitHub Desktop.
maven-dockerfile-plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM openjdk:8-jdk | |
MAINTAINER Steven@CREAMS <[email protected]> | |
# 设置时区 | |
RUN ln -sf /usr/share/zoneinfo/Asia/ShangHai /etc/localtime \ | |
&& echo "Asia/Shanghai" > /etc/timezone \ | |
&& dpkg-reconfigure -f noninteractive tzdata | |
ARG JAR_FILE | |
ADD target/${JAR_FILE} app.jar | |
ENV JVM_OPTS="-Xmx2048m" | |
ENV JAVA_OPTS="" | |
ENTRYPOINT [ "sh", "-c", "exec java $JVM_OPTS $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -XX:NativeMemoryTracking=summary -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/heap -verbose:gc -Xloggc:gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -jar /app.jar" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- https://github.com/spotify/dockerfile-maven --> | |
<plugin> | |
<groupId>com.spotify</groupId> | |
<artifactId>dockerfile-maven-plugin</artifactId> | |
<version>1.4.10</version> | |
<executions> | |
<execution> | |
<id>package-with-build-docker</id> | |
<phase>package</phase> | |
<goals> | |
<goal>build</goal> | |
</goals> | |
</execution> | |
</executions> | |
<configuration> | |
<repository>creams/${project.artifactId}</repository> | |
<tag>latest</tag> | |
<dockerfile>Dockerfile</dockerfile> | |
<buildArgs> | |
<JAR_FILE>${project.build.finalName}.jar</JAR_FILE> | |
</buildArgs> | |
</configuration> | |
</plugin> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment