Browse Source

switch docker to use startup.sh entrypoint

jrivard@gmail.com 6 years ago
parent
commit
11aedbc42e

+ 5 - 6
docker/pom.xml

@@ -25,7 +25,7 @@
             <plugin>
                 <groupId>com.google.cloud.tools</groupId>
                 <artifactId>jib-maven-plugin</artifactId>
-                <version>0.10.0</version>
+                <version>0.10.1</version>
                 <executions>
                     <execution>
                         <id>make-docker-image</id>
@@ -42,14 +42,13 @@
                             </to>
                             <container>
                                 <entrypoint>
-                                    <arg>java</arg>
-                                    <arg>-jar</arg>
-                                    <arg>/app/libs/pwm-onejar-${project.version}.jar</arg>
-                                    <arg>-applicationPath</arg>
-                                    <arg>/config</arg>
+                                    <arg>/app/startup.sh</arg>
                                 </entrypoint>
                                 <format>docker</format>
                                 <ports>8443</ports>
+                                <volumes>
+                                    <volume>/config</volume>
+                                </volumes>
                             </container>
                             <extraDirectory>
                                 <path>${project.basedir}/src/main/image-files</path> <!-- Copies files from 'src/main/custom-extra-dir' -->

+ 1 - 9
docker/src/main/image-files/app/java.vmoptions

@@ -1,12 +1,4 @@
 -server
 -Xmx1g
 -Xms1g
--Dcom.sun.jndi.ldap.object.disableEndpointIdentification=true
--XX:ErrorFile=/config/logs/java_error%p.log
--Xloggc:/config/logs/gc.log
--XX:+PrintGCDateStamps
--XX:+PrintGCTimeStamps
--XX:+PrintGCDetails
--XX:+UseGCLogFileRotation
--XX:GCLogFileSize=10M
--XX:NumberOfGCLogFiles=10
+-Xlog:gc:file=/config/logs/gc.log:time,uptime,level,tags:filecount=10,filesize=10M

+ 4 - 2
docker/src/main/image-files/app/startup.sh

@@ -1,7 +1,9 @@
 #!/usr/bin/env bash
 #Docker Container startup script
 
-JAVA_OPTS="$(sed 's/./&/' java.vmoptions | tr '\n' ' ')"
+JAVA_OPTS="$(sed 's/./&/' /app/java.vmoptions | tr '\n' ' ')"
 export JAVA_OPTS
 
-java -jar /app/libs/pwm-onejar*.jar $JAVA_OPTS -applicationPath /config
+mkdir -p /config/logs
+
+java $JAVA_OPTS -jar /app/libs/*onejar*.jar -applicationPath /config