Explorar o código

use /dev/urandom as entropy source, hope it will make it run on VMs with low entropy

Zhang Cheng %!s(int64=8) %!d(string=hai) anos
pai
achega
a2bbd15af2
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      docker-entry.sh

+ 5 - 0
docker-entry.sh

@@ -100,6 +100,11 @@ if [ ! -d "$WEBAPP_DIR" ]; then
     init_run
 fi
 
+# On some boxes with low entropy, tomcat will stuck at start up. It often happens with docker-machine VMs on macos and cloud VM hosts.
+# The dirty hack is to use /dev/urandom as entropy source, it is not recommemded as it reduces security.
+# See: https://wiki.apache.org/tomcat/HowTo/FasterStartUp#Entropy_Source
+export JAVA_OPTS="-Djava.security.egd=file:///dev/urandom $JAVA_OPTS"
+
 # start tomcat
 if [ -z "$@" ]; then
     exec $CATALINA_HOME/bin/catalina.sh run