You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ma...@apache.org on 2019/06/28 14:17:32 UTC

[james-project] 01/03: JAMES-2773 add glowroot to docker image

This is an automated email from the ASF dual-hosted git repository.

matthieu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 130f1d822ece4aa585c416d598907f6220480ab1
Author: RĂ©mi Kowalski <rk...@linagora.com>
AuthorDate: Tue May 14 11:58:01 2019 +0200

    JAMES-2773 add glowroot to docker image
---
 dockerfiles/compilation/java-8/compile.sh          | 27 ++++++++++++++++++++++
 dockerfiles/run/guice/cassandra-ldap/Dockerfile    | 17 +++++++++++---
 .../cassandra-ldap/destination/glowroot/admin.json |  5 ++++
 .../guice/cassandra-ldap/destination/run_james.sh  |  5 ++++
 .../run/guice/cassandra-rabbitmq-ldap/Dockerfile   | 17 +++++++++++---
 .../destination/glowroot/admin.json                |  5 ++++
 .../destination/run_james.sh                       |  5 ++++
 .../run/guice/cassandra-rabbitmq/Dockerfile        | 17 +++++++++++---
 .../destination/glowroot/admin.json                |  5 ++++
 .../cassandra-rabbitmq/destination/run_james.sh    |  5 ++++
 dockerfiles/run/guice/cassandra/Dockerfile         | 17 +++++++++++---
 .../cassandra/destination/glowroot/admin.json      |  5 ++++
 .../run/guice/cassandra/destination/run_james.sh   |  5 ++++
 dockerfiles/run/guice/jpa-smtp/Dockerfile          | 18 ++++++++++++---
 .../guice/jpa-smtp/destination/glowroot/admin.json |  5 ++++
 .../run/guice/jpa-smtp/destination/run_james.sh    |  5 ++++
 dockerfiles/run/guice/jpa/Dockerfile               | 18 ++++++++++++---
 .../run/guice/jpa/destination/glowroot/admin.json  |  5 ++++
 dockerfiles/run/guice/jpa/destination/run_james.sh |  5 ++++
 dockerfiles/run/guice/memory/Dockerfile            | 17 +++++++++++---
 .../guice/memory/destination/glowroot/admin.json   |  5 ++++
 .../run/guice/memory/destination/run_james.sh      |  5 ++++
 dockerfiles/run/spring/Dockerfile                  | 16 +++++++++++--
 dockerfiles/run/spring/destination/admin.json      |  5 ++++
 .../run/spring/destination/glowroot/admin.json     |  5 ++++
 dockerfiles/run/spring/destination/run_james.sh    |  5 ++++
 26 files changed, 226 insertions(+), 23 deletions(-)

diff --git a/dockerfiles/compilation/java-8/compile.sh b/dockerfiles/compilation/java-8/compile.sh
index fff263f..c30f77d 100755
--- a/dockerfiles/compilation/java-8/compile.sh
+++ b/dockerfiles/compilation/java-8/compile.sh
@@ -12,6 +12,12 @@ printUsage() {
    exit 1
 }
 
+GLOW_ROOT_URL=https://github.com/glowroot/glowroot/releases/download/v0.13.4/glowroot-0.13.4-dist.zip
+GLOW_ROOT_DIR=glowroot
+GLOW_ROOT_ZIP=glowroot.zip
+GLOW_ROOT_JAR=${GLOW_ROOT_DIR}/glowroot.jar
+GLOW_ROOT_LIB=${GLOW_ROOT_DIR}/lib
+
 ORIGIN=/origin
 CASSANDRA_DESTINATION=/cassandra/destination
 CASSANDRA_RABBITMQ_DESTINATION=/cassandra-rabbitmq/destination
@@ -59,6 +65,9 @@ else
    mvn package ${MVN_ADDITIONAL_ARG_LINE}
 fi
 
+# download glowroot jar
+wget  -O $GLOW_ROOT_ZIP $GLOW_ROOT_URL
+unzip $GLOW_ROOT_ZIP
 # Retrieve result
 
 if [ $? -eq 0 ]; then
@@ -68,6 +77,8 @@ if [ $? -eq 0 ]; then
       cp -r server/container/guice/cassandra-rabbitmq-ldap-guice/target/james-server-cassandra-rabbitmq-ldap-guice.lib $CASSANDRA_RABBITMQ_LDAP_DESTINATION || true
       cp server/container/cli/target/james-server-cli.jar $CASSANDRA_RABBITMQ_LDAP_DESTINATION || true
       cp -r server/container/cli/target/james-server-cli.lib $CASSANDRA_RABBITMQ_LDAP_DESTINATION || true
+      mkdir -p ${CASSANDRA_RABBITMQ_LDAP_DESTINATION}/glowroot
+      cp -r ${GLOW_ROOT_DIR}/* ${CASSANDRA_RABBITMQ_LDAP_DESTINATION}/glowroot || true
    fi
 
    if [ -d "$CASSANDRA_RABBITMQ_DESTINATION" ]; then
@@ -76,6 +87,8 @@ if [ $? -eq 0 ]; then
       cp -r server/container/guice/cassandra-rabbitmq-guice/target/james-server-cassandra-rabbitmq-guice.lib $CASSANDRA_RABBITMQ_DESTINATION || true
       cp server/container/cli/target/james-server-cli.jar $CASSANDRA_RABBITMQ_DESTINATION || true
       cp -r server/container/cli/target/james-server-cli.lib $CASSANDRA_RABBITMQ_DESTINATION || true
+      mkdir -p ${CASSANDRA_RABBITMQ_DESTINATION}/glowroot
+      cp -r ${GLOW_ROOT_DIR}/* ${CASSANDRA_RABBITMQ_DESTINATION}/glowroot || true
    fi
 
    if [ -d "$CASSANDRA_DESTINATION" ]; then
@@ -87,6 +100,8 @@ if [ $? -eq 0 ]; then
 
       cp server/container/guice/cassandra-ldap-guice/target/james-server-cassandra-ldap-guice.jar $CASSANDRA_DESTINATION || true
       cp -r server/container/guice/cassandra-ldap-guice/target/james-server-cassandra-ldap-guice.lib $CASSANDRA_DESTINATION || true
+      mkdir -p ${CASSANDRA_DESTINATION}/glowroot
+      cp -r ${GLOW_ROOT_DIR}/* ${CASSANDRA_DESTINATION}/glowroot || true
    fi
 
    if [ -d "$JPA_DESTINATION" ]; then
@@ -95,6 +110,8 @@ if [ $? -eq 0 ]; then
       cp -r server/container/guice/jpa-guice/target/james-server-jpa-guice.lib $JPA_DESTINATION || true
       cp server/container/cli/target/james-server-cli.jar $JPA_DESTINATION || true
       cp -r server/container/cli/target/james-server-cli.lib $JPA_DESTINATION || true
+      mkdir -p ${JPA_DESTINATION}/glowroot
+      cp -r ${GLOW_ROOT_DIR}/* ${JPA_DESTINATION}/glowroot || true
    fi
 
    if [ -d "$JPA_SMTP_DESTINATION" ]; then
@@ -103,6 +120,8 @@ if [ $? -eq 0 ]; then
       cp -r server/container/guice/jpa-smpt/target/james-server-jpa-smtp-guice.lib $JPA_SMTP_DESTINATION || true
       cp server/container/cli/target/james-server-cli.jar $JPA_SMTP_DESTINATION || true
       cp -r server/container/cli/target/james-server-cli.lib $JPA_SMTP_DESTINATION || true
+      mkdir -p ${JPA_SMTP_DESTINATION}/glowroot
+      cp -r ${GLOW_ROOT_DIR}/* ${JPA_SMTP_DESTINATION}/glowroot || true
    fi
 
    if [ -d "$MEMORY_DESTINATION" ]; then
@@ -111,11 +130,15 @@ if [ $? -eq 0 ]; then
       cp -r server/container/guice/memory-guice/target/james-server-memory-guice.lib $MEMORY_DESTINATION || true
       cp server/container/cli/target/james-server-cli.jar $MEMORY_DESTINATION || true
       cp -r server/container/cli/target/james-server-cli.lib $MEMORY_DESTINATION || true
+      mkdir -p ${MEMORY_DESTINATION}/glowroot
+      cp -r ${GLOW_ROOT_DIR}/* ${MEMORY_DESTINATION}/glowroot || true
    fi
 
    if [ -d "$SPRING_DESTINATION" ]; then
       echo "Copying SPRING jars"
       cp server/app/target/james-server-app-*-app.zip $SPRING_DESTINATION
+      mkdir -p ${SPRING_DESTINATION}/glowroot
+      cp -r ${GLOW_ROOT_DIR}/* ${SPRING_DESTINATION}/glowroot || true
    fi
 
    if [ -d "$SWAGGER_DESTINATION" ]; then
@@ -124,3 +147,7 @@ if [ $? -eq 0 ]; then
       cp server/protocols/webadmin/webadmin-swagger/target/webadmin-swagger.json $SWAGGER_DESTINATION || true
    fi
 fi
+
+# delete temporary glowroot files
+rm $GLOW_ROOT_ZIP
+rm -rf $GLOW_ROOT_DIR
diff --git a/dockerfiles/run/guice/cassandra-ldap/Dockerfile b/dockerfiles/run/guice/cassandra-ldap/Dockerfile
index b06597b..dd5db36 100644
--- a/dockerfiles/run/guice/cassandra-ldap/Dockerfile
+++ b/dockerfiles/run/guice/cassandra-ldap/Dockerfile
@@ -14,7 +14,7 @@ FROM openjdk:8u181-jre
 # 993  IMAP with socketTLS enabled
 # 8000 Web Admin interface (unsecured: expose at your own risks)
 
-EXPOSE 25 110 143 465 587 993 8000
+EXPOSE 25 110 143 465 587 993 4000 8000
 
 WORKDIR /root
 
@@ -24,9 +24,20 @@ ADD destination/james-server-cassandra-ldap-guice.lib /root/james-server-cassand
 ADD destination/james-server-cli.jar /root/james-cli.jar
 ADD destination/james-server-cli.lib /root/james-server-cli.lib
 ADD destination/conf /root/conf
+ADD destination/glowroot/plugins /root/glowroot/plugins
+ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
+ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
+ADD destination/glowroot/lib/glowroot-logging-logstash.jar /root/glowroot/lib/glowroot-logging-logstash.jar
+ADD destination/glowroot/admin.json /root/glowroot/admin.json
+ADD destination/run_james.sh /root/run_james.sh
 
 VOLUME /logs
 VOLUME /root/conf
+VOLUME /root/glowroot/plugins
+VOLUME /root/glowroot/data
 
-ENV JVM_OPTIONS=""
-ENTRYPOINT java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS -jar james-server.jar
+ENV PATH "$PATH:/root/glowroot/lib" \
+    JVM_OPTIONS="" \
+    GLOWROOT_ACTIVATED="false"
+
+ENTRYPOINT ./run_james.sh
diff --git a/dockerfiles/run/guice/cassandra-ldap/destination/glowroot/admin.json b/dockerfiles/run/guice/cassandra-ldap/destination/glowroot/admin.json
new file mode 100644
index 0000000..c75c59d
--- /dev/null
+++ b/dockerfiles/run/guice/cassandra-ldap/destination/glowroot/admin.json
@@ -0,0 +1,5 @@
+{
+  "web": {
+    "bindAddress": "0.0.0.0"
+  }
+}
\ No newline at end of file
diff --git a/dockerfiles/run/guice/cassandra-ldap/destination/run_james.sh b/dockerfiles/run/guice/cassandra-ldap/destination/run_james.sh
new file mode 100755
index 0000000..02f2bf6
--- /dev/null
+++ b/dockerfiles/run/guice/cassandra-ldap/destination/run_james.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
+    GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
+fi
+java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS $GLOWROOT_OPTIONS -jar james-server.jar
\ No newline at end of file
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq-ldap/Dockerfile b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/Dockerfile
index e7e9692..24f06c4 100644
--- a/dockerfiles/run/guice/cassandra-rabbitmq-ldap/Dockerfile
+++ b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/Dockerfile
@@ -14,7 +14,7 @@ FROM openjdk:8u181-jre
 # 993  IMAP with socketTLS enabled
 # 8000 Web Admin interface (unsecured: expose at your own risks)
 
-EXPOSE 25 110 143 465 587 993 8000
+EXPOSE 25 110 143 465 587 993 4000 8000
 
 WORKDIR /root
 
@@ -24,9 +24,20 @@ ADD destination/james-server-cassandra-rabbitmq-ldap-guice.lib /root/james-serve
 ADD destination/james-server-cli.jar /root/james-cli.jar
 ADD destination/james-server-cli.lib /root/james-server-cli.lib
 ADD destination/conf /root/conf
+ADD destination/glowroot/plugins /root/glowroot/plugins
+ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
+ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
+ADD destination/glowroot/lib/glowroot-logging-logstash.jar /root/glowroot/lib/glowroot-logging-logstash.jar
+ADD destination/glowroot/admin.json /root/glowroot/admin.json
+ADD destination/run_james.sh /root/run_james.sh
 
 VOLUME /logs
 VOLUME /root/conf
+VOLUME /root/glowroot/plugins
+VOLUME /root/glowroot/data
 
-ENV JVM_OPTIONS=""
-ENTRYPOINT java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS -jar james-server.jar
+ENV PATH "$PATH:/root/glowroot/lib" \
+    JVM_OPTIONS="" \
+    GLOWROOT_ACTIVATED="false"
+
+ENTRYPOINT ./run_james.sh
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/glowroot/admin.json b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/glowroot/admin.json
new file mode 100644
index 0000000..c75c59d
--- /dev/null
+++ b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/glowroot/admin.json
@@ -0,0 +1,5 @@
+{
+  "web": {
+    "bindAddress": "0.0.0.0"
+  }
+}
\ No newline at end of file
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/run_james.sh b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/run_james.sh
new file mode 100755
index 0000000..02f2bf6
--- /dev/null
+++ b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/run_james.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
+    GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
+fi
+java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS $GLOWROOT_OPTIONS -jar james-server.jar
\ No newline at end of file
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/Dockerfile b/dockerfiles/run/guice/cassandra-rabbitmq/Dockerfile
index f9f2919..922e0e3 100644
--- a/dockerfiles/run/guice/cassandra-rabbitmq/Dockerfile
+++ b/dockerfiles/run/guice/cassandra-rabbitmq/Dockerfile
@@ -14,7 +14,7 @@ FROM openjdk:8u181-jre
 # 993  IMAP with socketTLS enabled
 # 8000 Web Admin interface (unsecured: expose at your own risks)
 
-EXPOSE 25 110 143 465 587 993 8000
+EXPOSE 25 110 143 465 587 993 4000 8000
 
 WORKDIR /root
 
@@ -24,9 +24,20 @@ ADD destination/james-server-cassandra-rabbitmq-guice.lib /root/james-server-cas
 ADD destination/james-server-cli.jar /root/james-cli.jar
 ADD destination/james-server-cli.lib /root/james-server-cli.lib
 ADD destination/conf /root/conf
+ADD destination/glowroot/plugins /root/glowroot/plugins
+ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
+ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
+ADD destination/glowroot/lib/glowroot-logging-logstash.jar /root/glowroot/lib/glowroot-logging-logstash.jar
+ADD destination/glowroot/admin.json /root/glowroot/admin.json
+ADD destination/run_james.sh /root/run_james.sh
 
 VOLUME /logs
 VOLUME /root/conf
+VOLUME /root/glowroot/plugins
+VOLUME /root/glowroot/data
 
-ENV JVM_OPTIONS=""
-ENTRYPOINT java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS -jar james-server.jar
+ENV PATH "$PATH:/root/glowroot/lib" \
+    JVM_OPTIONS="" \
+    GLOWROOT_ACTIVATED="false"
+
+ENTRYPOINT ./run_james.sh
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/admin.json b/dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/admin.json
new file mode 100644
index 0000000..c75c59d
--- /dev/null
+++ b/dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/admin.json
@@ -0,0 +1,5 @@
+{
+  "web": {
+    "bindAddress": "0.0.0.0"
+  }
+}
\ No newline at end of file
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/destination/run_james.sh b/dockerfiles/run/guice/cassandra-rabbitmq/destination/run_james.sh
new file mode 100755
index 0000000..02f2bf6
--- /dev/null
+++ b/dockerfiles/run/guice/cassandra-rabbitmq/destination/run_james.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
+    GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
+fi
+java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS $GLOWROOT_OPTIONS -jar james-server.jar
\ No newline at end of file
diff --git a/dockerfiles/run/guice/cassandra/Dockerfile b/dockerfiles/run/guice/cassandra/Dockerfile
index c17430e..43f3c69 100644
--- a/dockerfiles/run/guice/cassandra/Dockerfile
+++ b/dockerfiles/run/guice/cassandra/Dockerfile
@@ -14,7 +14,7 @@ FROM openjdk:8u181-jre
 # 993  IMAP with socketTLS enabled
 # 8000 Web Admin interface (unsecured: expose at your own risks)
 
-EXPOSE 25 110 143 465 587 993 8000
+EXPOSE 25 110 143 465 587 993 4000 8000
 
 WORKDIR /root
 
@@ -24,9 +24,20 @@ ADD destination/james-server-cassandra-guice.lib /root/james-server-cassandra-gu
 ADD destination/james-server-cli.jar /root/james-cli.jar
 ADD destination/james-server-cli.lib /root/james-server-cli.lib
 ADD destination/conf /root/conf
+ADD destination/glowroot/plugins /root/glowroot/plugins
+ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
+ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
+ADD destination/glowroot/lib/glowroot-logging-logstash.jar /root/glowroot/lib/glowroot-logging-logstash.jar
+ADD destination/glowroot/admin.json /root/glowroot/admin.json
+ADD destination/run_james.sh /root/run_james.sh
 
 VOLUME /logs
 VOLUME /root/conf
+VOLUME /root/glowroot/plugins
+VOLUME /root/glowroot/data
 
-ENV JVM_OPTIONS=""
-ENTRYPOINT java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS -jar james-server.jar
+ENV PATH "$PATH:/root/glowroot/lib" \
+    JVM_OPTIONS="" \
+    GLOWROOT_ACTIVATED="false"
+
+ENTRYPOINT ./run_james.sh
diff --git a/dockerfiles/run/guice/cassandra/destination/glowroot/admin.json b/dockerfiles/run/guice/cassandra/destination/glowroot/admin.json
new file mode 100644
index 0000000..c75c59d
--- /dev/null
+++ b/dockerfiles/run/guice/cassandra/destination/glowroot/admin.json
@@ -0,0 +1,5 @@
+{
+  "web": {
+    "bindAddress": "0.0.0.0"
+  }
+}
\ No newline at end of file
diff --git a/dockerfiles/run/guice/cassandra/destination/run_james.sh b/dockerfiles/run/guice/cassandra/destination/run_james.sh
new file mode 100755
index 0000000..02f2bf6
--- /dev/null
+++ b/dockerfiles/run/guice/cassandra/destination/run_james.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
+    GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
+fi
+java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS $GLOWROOT_OPTIONS -jar james-server.jar
\ No newline at end of file
diff --git a/dockerfiles/run/guice/jpa-smtp/Dockerfile b/dockerfiles/run/guice/jpa-smtp/Dockerfile
index 0335a81..2eb86ff 100644
--- a/dockerfiles/run/guice/jpa-smtp/Dockerfile
+++ b/dockerfiles/run/guice/jpa-smtp/Dockerfile
@@ -12,7 +12,7 @@ FROM openjdk:8u181-jre
 # 587  SMTP with authentication and startTLS enabled
 # 8000 Web Admin interface (unsecured: expose at your own risks)
 
-EXPOSE 25 143 465 587 8000
+EXPOSE 25 143 465 587 4000 8000
 
 WORKDIR /root
 
@@ -22,8 +22,20 @@ ADD destination/james-server-jpa-smtp-guice.lib /root/james-server-jpa-smtp-guic
 ADD destination/james-server-cli.jar /root/james-cli.jar
 ADD destination/james-server-cli.lib /root/james-server-cli.lib
 ADD destination/conf /root/conf
+ADD destination/glowroot/plugins /root/glowroot/plugins
+ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
+ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
+ADD destination/glowroot/lib/glowroot-logging-logstash.jar /root/glowroot/lib/glowroot-logging-logstash.jar
+ADD destination/glowroot/admin.json /root/glowroot/admin.json
+ADD destination/run_james.sh /root/run_james.sh
 
 VOLUME /logs
+VOLUME /root/conf
+VOLUME /root/glowroot/plugins
+VOLUME /root/glowroot/data
 
-ENV JVM_OPTIONS=""
-ENTRYPOINT java -classpath '/root/james-server-jpa-smtp-guice.jar:/root/james-server-jpa-smtp-guice.lib/*' -javaagent:/root/james-server-jpa-smtp-guice.lib/openjpa-3.0.0.jar -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS org.apache.james.JPAJamesServerMain
+ENV PATH "$PATH:/root/glowroot/lib" \
+    JVM_OPTIONS="" \
+    GLOWROOT_ACTIVATED="false"
+
+ENTRYPOINT ./run_james.sh
diff --git a/dockerfiles/run/guice/jpa-smtp/destination/glowroot/admin.json b/dockerfiles/run/guice/jpa-smtp/destination/glowroot/admin.json
new file mode 100644
index 0000000..c75c59d
--- /dev/null
+++ b/dockerfiles/run/guice/jpa-smtp/destination/glowroot/admin.json
@@ -0,0 +1,5 @@
+{
+  "web": {
+    "bindAddress": "0.0.0.0"
+  }
+}
\ No newline at end of file
diff --git a/dockerfiles/run/guice/jpa-smtp/destination/run_james.sh b/dockerfiles/run/guice/jpa-smtp/destination/run_james.sh
new file mode 100755
index 0000000..dc72c7d
--- /dev/null
+++ b/dockerfiles/run/guice/jpa-smtp/destination/run_james.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
+    GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
+fi
+java -classpath '/root/james-server-jpa-smtp-guice.jar:/root/james-server-jpa-smtp-guice.lib/*' -javaagent:/root/james-server-jpa-smtp-guice.lib/openjpa-3.0.0.jar $GLOWROOT_OPTIONS -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS org.apache.james.JPAJamesServerMain
\ No newline at end of file
diff --git a/dockerfiles/run/guice/jpa/Dockerfile b/dockerfiles/run/guice/jpa/Dockerfile
index 8f641cf..07e386f 100644
--- a/dockerfiles/run/guice/jpa/Dockerfile
+++ b/dockerfiles/run/guice/jpa/Dockerfile
@@ -14,7 +14,7 @@ FROM openjdk:8u181-jre
 # 993  IMAP with socketTLS enabled
 # 8000 Web Admin interface (unsecured: expose at your own risks)
 
-EXPOSE 25 110 143 465 587 993 8000
+EXPOSE 25 110 143 465 587 993 4000 8000
 
 WORKDIR /root
 
@@ -24,8 +24,20 @@ ADD destination/james-server-jpa-guice.lib /root/james-server-jpa-guice.lib
 ADD destination/james-server-cli.jar /root/james-cli.jar
 ADD destination/james-server-cli.lib /root/james-server-cli.lib
 ADD destination/conf /root/conf
+ADD destination/glowroot/plugins /root/glowroot/plugins
+ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
+ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
+ADD destination/glowroot/lib/glowroot-logging-logstash.jar /root/glowroot/lib/glowroot-logging-logstash.jar
+ADD destination/glowroot/admin.json /root/glowroot/admin.json
+ADD destination/run_james.sh /root/run_james.sh
 
 VOLUME /logs
+VOLUME /root/conf
+VOLUME /root/glowroot/plugins
+VOLUME /root/glowroot/data
 
-ENV JVM_OPTIONS=""
-ENTRYPOINT java -classpath '/root/james-server.jar:/root/james-server-jpa-guice.lib/*' -javaagent:/root/james-server-jpa-guice.lib/openjpa-3.0.0.jar -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS org.apache.james.JPAJamesServerMain
+ENV PATH "$PATH:/root/glowroot/lib" \
+    JVM_OPTIONS="" \
+    GLOWROOT_ACTIVATED="false"
+
+ENTRYPOINT ./run_james.sh
\ No newline at end of file
diff --git a/dockerfiles/run/guice/jpa/destination/glowroot/admin.json b/dockerfiles/run/guice/jpa/destination/glowroot/admin.json
new file mode 100644
index 0000000..c75c59d
--- /dev/null
+++ b/dockerfiles/run/guice/jpa/destination/glowroot/admin.json
@@ -0,0 +1,5 @@
+{
+  "web": {
+    "bindAddress": "0.0.0.0"
+  }
+}
\ No newline at end of file
diff --git a/dockerfiles/run/guice/jpa/destination/run_james.sh b/dockerfiles/run/guice/jpa/destination/run_james.sh
new file mode 100755
index 0000000..7503c8b
--- /dev/null
+++ b/dockerfiles/run/guice/jpa/destination/run_james.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
+    GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
+fi
+java -classpath '/root/james-server.jar:/root/james-server-jpa-guice.lib/*' -javaagent:/root/james-server-jpa-guice.lib/openjpa-3.0.0.jar $GLOWROOT_OPTIONS -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS org.apache.james.JPAJamesServerMain
diff --git a/dockerfiles/run/guice/memory/Dockerfile b/dockerfiles/run/guice/memory/Dockerfile
index e969bf8..93e3bd1 100644
--- a/dockerfiles/run/guice/memory/Dockerfile
+++ b/dockerfiles/run/guice/memory/Dockerfile
@@ -14,7 +14,7 @@ FROM openjdk:8u181-jre
 # 993  IMAP with socketTLS enabled
 # 8000 Web Admin interface (unsecured: expose at your own risks)
 
-EXPOSE 25 110 143 465 587 993 8000
+EXPOSE 25 110 143 465 587 993 4000 8000
 
 WORKDIR /root
 
@@ -24,9 +24,20 @@ ADD destination/james-server-memory-guice.lib /root/james-server-memory-guice.li
 ADD destination/james-server-cli.jar /root/james-cli.jar
 ADD destination/james-server-cli.lib /root/james-server-cli.lib
 ADD destination/conf /root/conf
+ADD destination/glowroot/plugins /root/glowroot/plugins
+ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
+ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
+ADD destination/glowroot/lib/glowroot-logging-logstash.jar /root/glowroot/lib/glowroot-logging-logstash.jar
+ADD destination/glowroot/admin.json /root/glowroot/admin.json
+ADD destination/run_james.sh /root/run_james.sh
 
 VOLUME /logs
 VOLUME /root/conf
+VOLUME /root/glowroot/plugins
+VOLUME /root/glowroot/data
 
-ENV JVM_OPTIONS=""
-ENTRYPOINT java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS -jar james-server.jar
+ENV PATH "$PATH:/root/glowroot/lib" \
+    JVM_OPTIONS="" \
+    GLOWROOT_ACTIVATED="false"
+
+ENTRYPOINT ./run_james.sh
diff --git a/dockerfiles/run/guice/memory/destination/glowroot/admin.json b/dockerfiles/run/guice/memory/destination/glowroot/admin.json
new file mode 100644
index 0000000..c75c59d
--- /dev/null
+++ b/dockerfiles/run/guice/memory/destination/glowroot/admin.json
@@ -0,0 +1,5 @@
+{
+  "web": {
+    "bindAddress": "0.0.0.0"
+  }
+}
\ No newline at end of file
diff --git a/dockerfiles/run/guice/memory/destination/run_james.sh b/dockerfiles/run/guice/memory/destination/run_james.sh
new file mode 100755
index 0000000..02f2bf6
--- /dev/null
+++ b/dockerfiles/run/guice/memory/destination/run_james.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
+    GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
+fi
+java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS $GLOWROOT_OPTIONS -jar james-server.jar
\ No newline at end of file
diff --git a/dockerfiles/run/spring/Dockerfile b/dockerfiles/run/spring/Dockerfile
index 49b5f0e..ff94ea4 100644
--- a/dockerfiles/run/spring/Dockerfile
+++ b/dockerfiles/run/spring/Dockerfile
@@ -13,13 +13,23 @@ FROM openjdk:8u181-jre
 # 587 SMTP with authentication and startTLS enabled
 # 993 IMAP with socketTLS enabled
 
-EXPOSE 25 110 143 465 587 993
+EXPOSE 25 110 143 465 587 993 4000
 
 WORKDIR /root
 
 # Get data we need to run James : build results and configuration
 ADD destination/james-server-app-3.4.0-SNAPSHOT-app.zip /root/james-server-app-3.4.0-SNAPSHOT-app.zip
 ADD destination/conf /root/conf
+ADD destination/glowroot/plugins /root/glowroot/plugins
+ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
+ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
+ADD destination/glowroot/lib/glowroot-logging-logstash.jar /root/glowroot/lib/glowroot-logging-logstash.jar
+ADD destination/glowroot/admin.json /root/glowroot/admin.json
+ADD destination/run_james.sh /root/run_james.sh
+
+VOLUME /logs
+VOLUME /root/conf
+VOLUME /root/glowroot/plugins
 
 # Unzip build result
 RUN unzip james-server-app-3.4.0-SNAPSHOT-app.zip
@@ -31,5 +41,7 @@ RUN rm -r james-server-app-3.4.0-SNAPSHOT/conf/*
 RUN cp -r conf/* james-server-app-3.4.0-SNAPSHOT/conf
 RUN cp wrapper.conf james-server-app-3.4.0-SNAPSHOT/conf
 
+ENV PATH "$PATH:/root/glowroot/lib"
+
 WORKDIR /root/james-server-app-3.4.0-SNAPSHOT/bin
-ENTRYPOINT ["./wrapper-linux-x86-64","../conf/wrapper.conf", "wrapper.syslog.ident=james", "wrapper.pidfile=../var/james.pid", "wrapper.daemonize=FALSE"]
+ENTRYPOINT /root/run_james.sh
\ No newline at end of file
diff --git a/dockerfiles/run/spring/destination/admin.json b/dockerfiles/run/spring/destination/admin.json
new file mode 100644
index 0000000..c75c59d
--- /dev/null
+++ b/dockerfiles/run/spring/destination/admin.json
@@ -0,0 +1,5 @@
+{
+  "web": {
+    "bindAddress": "0.0.0.0"
+  }
+}
\ No newline at end of file
diff --git a/dockerfiles/run/spring/destination/glowroot/admin.json b/dockerfiles/run/spring/destination/glowroot/admin.json
new file mode 100644
index 0000000..c75c59d
--- /dev/null
+++ b/dockerfiles/run/spring/destination/glowroot/admin.json
@@ -0,0 +1,5 @@
+{
+  "web": {
+    "bindAddress": "0.0.0.0"
+  }
+}
\ No newline at end of file
diff --git a/dockerfiles/run/spring/destination/run_james.sh b/dockerfiles/run/spring/destination/run_james.sh
new file mode 100755
index 0000000..6697c5b
--- /dev/null
+++ b/dockerfiles/run/spring/destination/run_james.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
+    GLOWROOT_OPTIONS=wrapper.java.additional.15=-javaagent:/root/glowroot/glowroot.jar
+fi
+./wrapper-linux-x86-64 ../conf/wrapper.conf wrapper.syslog.ident=james wrapper.pidfile=../var/james.pid wrapper.daemonize=FALSE $GLOWROOT_OPTIONS


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org