Skip to content

Commit

Permalink
Move Docker startup to Dockerfile to allow setting the JAVA_OPTS
Browse files Browse the repository at this point in the history
  • Loading branch information
malacroix committed May 8, 2018
1 parent f4b6691 commit 2378a16
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
23 changes: 9 additions & 14 deletions sample-isv-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -234,26 +234,21 @@
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.13</version>
<configuration>
<env>
<JAVA_OPTS>""</JAVA_OPTS>
</env>
<skipDocker>false</skipDocker>
<baseImage>openjdk:8u121-jdk</baseImage>
<imageName>docker.appdirectondemand.com/sample-isv/sample-isv</imageName>
<entryPoint>["java", "-server", "-Djava.security.egd=file:/dev/urandom", "-Xms160m", "-Xmx160m", "-XX:MaxMetaspaceSize=96m", "-Xss512k", "$JAVA_OPTS", "-jar", "/${project.build.finalName}.jar"]</entryPoint>
<imageTags>
<imageTag>${project.version}</imageTag>
</imageTags>
<serverId>docker</serverId>
<dockerHost>unix:///var/run/docker.sock</dockerHost>
<registryUrl>https://docker.appdirectondemand.com/v2/</registryUrl>
<dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
<imageName>docker.appdirect.tools/sample-isv/sample-isv</imageName>
<imageTags>
<imageTag>${project.version}</imageTag>
</imageTags>
<serverId>docker</serverId>
<registryUrl>https://docker.appdirect.tools/v2/</registryUrl>
</configuration>
</plugin>
</plugins>
Expand All @@ -270,8 +265,8 @@
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<imageName>docker.appdirectondemand.com/sample-isv/sample-isv</imageName>
<registryUrl>https://docker.appdirectondemand.com/v2</registryUrl>
<imageName>docker.appdirect.tools/sample-isv/sample-isv</imageName>
<registryUrl>https://docker.appdirect.tools/v2</registryUrl>
<serverId>docker</serverId>
<pushImage>true</pushImage>
</configuration>
Expand Down
11 changes: 11 additions & 0 deletions sample-isv-web/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM openjdk:8-jre-alpine

ADD sample-isv-web.jar sample-isv-web.jar

ENV XMS "-Xms160m"
ENV XMX "-Xmx160m"
ENV METASPACE "-XX:MaxMetaspaceSize=96m"
ENV XSS "-Xss512k"
ENV JAVA_OPTS=""

ENTRYPOINT [ "sh", "-c", "exec java -server -Djava.security.egd=file:/dev/urandom $XMS $XMX $METASPACE $XSS $JAVA_OPTS -jar /sample-isv-web.jar" ]

0 comments on commit 2378a16

Please sign in to comment.