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

aldrin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/master by this push:
     new 6d4504d  NIFI-6067 Enabled support for the JVM remote debugger in the 
Docker container.
6d4504d is described below

commit 6d4504d662fc7a65110261d205f102360a90b544
Author: Mike Thomsen <[email protected]>
AuthorDate: Thu Feb 21 20:39:16 2019 -0500

    NIFI-6067 Enabled support for the JVM remote debugger in the Docker 
container.
    
    This closes #3326.
    
    Signed-off-by: Aldrin Piri <[email protected]>
---
 nifi-docker/dockerhub/Dockerfile     | 2 +-
 nifi-docker/dockerhub/README.md      | 2 ++
 nifi-docker/dockerhub/sh/common.sh   | 6 ++++++
 nifi-docker/dockerhub/sh/start.sh    | 4 ++++
 nifi-docker/dockermaven/Dockerfile   | 2 +-
 nifi-docker/dockermaven/sh/common.sh | 6 ++++++
 nifi-docker/dockermaven/sh/start.sh  | 4 ++++
 7 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/nifi-docker/dockerhub/Dockerfile b/nifi-docker/dockerhub/Dockerfile
index cf5f0a1..8a813fc 100644
--- a/nifi-docker/dockerhub/Dockerfile
+++ b/nifi-docker/dockerhub/Dockerfile
@@ -82,7 +82,7 @@ VOLUME ${NIFI_LOG_DIR} \
 RUN echo "#!/bin/sh\n" > $NIFI_HOME/bin/nifi-env.sh
 
 # Web HTTP(s) & Socket Site-to-Site Ports
-EXPOSE 8080 8443 10000
+EXPOSE 8080 8443 10000 8000
 
 WORKDIR ${NIFI_HOME}
 
diff --git a/nifi-docker/dockerhub/README.md b/nifi-docker/dockerhub/README.md
index 67dc172..b3784a6 100644
--- a/nifi-docker/dockerhub/README.md
+++ b/nifi-docker/dockerhub/README.md
@@ -188,11 +188,13 @@ can be published to the host.
 | HTTP Port                | nifi.web.http.port            | 8080  |
 | HTTPS Port               | nifi.web.https.port           | 8443  |
 | Remote Input Socket Port | nifi.remote.input.socket.port | 10000 |
+| JVM Debugger             | java.arg.debug                | 8000  |
 
 The Variable Registry can be configured for the docker image using the 
`NIFI_VARIABLE_REGISTRY_PROPERTIES` environment variable.
 
 The JVM Memory initial and maximum heap size can be set using the 
`NIFI_JVM_HEAP_INIT` and `NIFI_JVM_HEAP_MAX` environment variables. These use 
values acceptable to the JVM `Xmx` and `Xms` parameters such as `1g` or `512m`.
 
+The JVM Debugger can be enabled by setting the environment variable 
NIFI_JVM_DEBUGGER to any value.
 
 =======  
 **NOTE**: If NiFi is proxied at context paths other than the root path of the 
proxy, the paths need to be set in the 
diff --git a/nifi-docker/dockerhub/sh/common.sh 
b/nifi-docker/dockerhub/sh/common.sh
index e4770a0..f3ea435 100755
--- a/nifi-docker/dockerhub/sh/common.sh
+++ b/nifi-docker/dockerhub/sh/common.sh
@@ -23,6 +23,12 @@ prop_replace () {
   sed -i -e "s|^$1=.*$|$1=$2|"  ${target_file}
 }
 
+uncomment() {
+       target_file=${2}
+       echo "Uncommenting ${target_file}"
+       sed -i -e "s|^\#$1|$1|" ${target_file}
+}
+
 # NIFI_HOME is defined by an ENV command in the backing Dockerfile
 export nifi_bootstrap_file=${NIFI_HOME}/conf/bootstrap.conf
 export nifi_props_file=${NIFI_HOME}/conf/nifi.properties
diff --git a/nifi-docker/dockerhub/sh/start.sh 
b/nifi-docker/dockerhub/sh/start.sh
index 85b9248..1049e85 100755
--- a/nifi-docker/dockerhub/sh/start.sh
+++ b/nifi-docker/dockerhub/sh/start.sh
@@ -28,6 +28,10 @@ if [ ! -z "${NIFI_JVM_HEAP_MAX}" ]; then
     prop_replace 'java.arg.3'       "-Xmx${NIFI_JVM_HEAP_MAX}" 
${nifi_bootstrap_file}
 fi
 
+if [ ! -z "${NIFI_JVM_DEBUGGER}" ]; then
+    uncomment "java.arg.debug" ${nifi_bootstrap_file}
+fi
+
 # Establish baseline properties
 prop_replace 'nifi.web.http.port'               "${NIFI_WEB_HTTP_PORT:-8080}"
 prop_replace 'nifi.web.http.host'               
"${NIFI_WEB_HTTP_HOST:-$HOSTNAME}"
diff --git a/nifi-docker/dockermaven/Dockerfile 
b/nifi-docker/dockermaven/Dockerfile
index 25c3ab7..cb73c74 100644
--- a/nifi-docker/dockermaven/Dockerfile
+++ b/nifi-docker/dockermaven/Dockerfile
@@ -86,7 +86,7 @@ USER nifi
 RUN echo "#!/bin/sh\n" > $NIFI_HOME/bin/nifi-env.sh
 
 # Web HTTP(s) & Socket Site-to-Site Ports
-EXPOSE 8080 8443 10000
+EXPOSE 8080 8443 10000 8000
 
 WORKDIR ${NIFI_HOME}
 
diff --git a/nifi-docker/dockermaven/sh/common.sh 
b/nifi-docker/dockermaven/sh/common.sh
index e4770a0..f3ea435 100755
--- a/nifi-docker/dockermaven/sh/common.sh
+++ b/nifi-docker/dockermaven/sh/common.sh
@@ -23,6 +23,12 @@ prop_replace () {
   sed -i -e "s|^$1=.*$|$1=$2|"  ${target_file}
 }
 
+uncomment() {
+       target_file=${2}
+       echo "Uncommenting ${target_file}"
+       sed -i -e "s|^\#$1|$1|" ${target_file}
+}
+
 # NIFI_HOME is defined by an ENV command in the backing Dockerfile
 export nifi_bootstrap_file=${NIFI_HOME}/conf/bootstrap.conf
 export nifi_props_file=${NIFI_HOME}/conf/nifi.properties
diff --git a/nifi-docker/dockermaven/sh/start.sh 
b/nifi-docker/dockermaven/sh/start.sh
index 85b9248..1049e85 100755
--- a/nifi-docker/dockermaven/sh/start.sh
+++ b/nifi-docker/dockermaven/sh/start.sh
@@ -28,6 +28,10 @@ if [ ! -z "${NIFI_JVM_HEAP_MAX}" ]; then
     prop_replace 'java.arg.3'       "-Xmx${NIFI_JVM_HEAP_MAX}" 
${nifi_bootstrap_file}
 fi
 
+if [ ! -z "${NIFI_JVM_DEBUGGER}" ]; then
+    uncomment "java.arg.debug" ${nifi_bootstrap_file}
+fi
+
 # Establish baseline properties
 prop_replace 'nifi.web.http.port'               "${NIFI_WEB_HTTP_PORT:-8080}"
 prop_replace 'nifi.web.http.host'               
"${NIFI_WEB_HTTP_HOST:-$HOSTNAME}"

Reply via email to