From 03e410df249e353994908908c3f9e0e620730fbe Mon Sep 17 00:00:00 2001 From: Steffen Bleul Date: Mon, 21 Aug 2017 20:39:29 +0200 Subject: [PATCH] Fix for the feature that sets the catalina properties like memory usage. --- Dockerfile | 4 ++-- README.md | 5 +++-- docker-entrypoint.sh | 34 +++++++++++++++++++++------------- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6a79132..4127fbe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -95,9 +95,9 @@ LABEL com.blacklabelops.application.confluence.version=$CONFLUENCE_VERSION \ EXPOSE 8090 8091 USER confluence -VOLUME ["${CONF_HOME}"] +VOLUME ["/var/atlassian/confluence"] # Set the default working directory as the Confluence home directory. WORKDIR ${CONF_HOME} -COPY docker-entrypoint.sh ${CONF_SCRIPT_HOME}/docker-entrypoint.sh +COPY docker-entrypoint.sh /home/confluence/docker-entrypoint.sh ENTRYPOINT ["/sbin/tini","--","/home/confluence/docker-entrypoint.sh"] CMD ["confluence"] diff --git a/README.md b/README.md index c332799..e148b8c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Dockerized Atlassian Confluence +[![Open Issues](https://img.shields.io/github/issues/blacklabelops/confluence.svg)](https://github.com/blacklabelops/confluence/issues) [![Stars on GitHub](https://img.shields.io/github/stars/blacklabelops/confluence.svg)](https://github.com/cblacklabelops/confluence/stargazers) [![Docker Stars](https://img.shields.io/docker/stars/blacklabelops/confluence.svg)](https://hub.docker.com/r/blacklabelops/confluence/) [![Docker Pulls](https://img.shields.io/docker/pulls/blacklabelops/confluence.svg)](https://hub.docker.com/r/blacklabelops/confluence/) "One place for all your team's work - Spend less time hunting things down and more time making things happen. Organize your work, create documents, and discuss everything in one place." - [[Source](https://www.atlassian.com/software/confluence)] @@ -23,7 +24,7 @@ You may also like: # Make It Short ~~~~ -$ docker run -d -p 80:8090 -p 8091:8091 --name confluence blacklabelops/confluence +$ docker run -d -p 80:8090 --name confluence blacklabelops/confluence ~~~~ # Setup @@ -439,7 +440,7 @@ $ docker run -d -p 80:8090 \ -e "CATALINA_PARAMETER_VALUE2=1024m" \ -e "CATALINA_PARAMETER3=-Xmx" \ -e "CATALINA_PARAMETER_VALUE3=1024m" \ - blacklabelops/confluence:development + blacklabelops/confluence ~~~~ > Sets the synchrony proxy and memory settings. diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index eeef1c0..074c577 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -111,6 +111,8 @@ CATALINA_OPTS="-Datlassian.plugins.enable.wait=300 ${CATALINA_OPTS}" CATALINA_OPTS="-Xms1024m ${CATALINA_OPTS}" CATALINA_OPTS="-Xmx1024m ${CATALINA_OPTS}" CATALINA_OPTS="-XX:+UseG1GC ${CATALINA_OPTS}" +CATALINA_OPTS="${START_CONFLUENCE_JAVA_OPTS} ${CATALINA_OPTS}" +CATALINA_OPTS="-Dsynchrony.enable.xhr.fallback=true ${CATALINA_OPTS}" CATALINA_OPTS="-Dorg.apache.tomcat.websocket.DEFAULT_BUFFER_SIZE=32768 ${CATALINA_OPTS}" CATALINA_OPTS="-Dconfluence.context.path=${CONFLUENCE_CONTEXT_PATH} ${CATALINA_OPTS}"' >> ${CONF_INSTALL}/bin/setenv.sh echo "export CATALINA_OPTS" >> ${CONF_INSTALL}/bin/setenv.sh @@ -133,18 +135,22 @@ function setCatalinaConfigurationProperty() { } function processCatalinaConfigurationSettings() { - if [ -f "${CONF_INSTALL}/bin/setenv.sh" ]; then - sed -i "/export CATALINA_OPTS/d" ${CONF_INSTALL}/bin/setenv.sh - for (( i=1; ; i++ )) - do - VAR_CATALINA_PARAMETER="CATALINA_PARAMETER$i" - VAR_CATALINA_PARAMETER_VALUE="CATALINA_PARAMETER_VALUE$i" - if [ ! -n "${!VAR_CATALINA_PARAMETER}" ]; then - break - fi - setCatalinaConfigurationProperty ${!VAR_CATALINA_PARAMETER} ${!VAR_CATALINA_PARAMETER_VALUE} - done - echo "export CATALINA_OPTS" >> ${CONF_INSTALL}/bin/setenv.sh + VAR_CATALINA_PARAMETER="CATALINA_PARAMETER$i" + VAR_CATALINA_PARAMETER_VALUE="CATALINA_PARAMETER_VALUE$i" + if [ ! -n "${!VAR_CATALINA_PARAMETER}" ]; then + if [ -f "${CONF_INSTALL}/bin/setenv.sh" ]; then + sed -i "/export CATALINA_OPTS/d" ${CONF_INSTALL}/bin/setenv.sh + for (( i=1; ; i++ )) + do + VAR_CATALINA_PARAMETER="CATALINA_PARAMETER$i" + VAR_CATALINA_PARAMETER_VALUE="CATALINA_PARAMETER_VALUE$i" + if [ ! -n "${!VAR_CATALINA_PARAMETER}" ]; then + break + fi + setCatalinaConfigurationProperty ${!VAR_CATALINA_PARAMETER} ${!VAR_CATALINA_PARAMETER_VALUE} + done + echo "export CATALINA_OPTS" >> ${CONF_INSTALL}/bin/setenv.sh + fi fi } @@ -162,7 +168,9 @@ processConfluenceConfigurationSettings processCatalinaDefaultConfiguration -processCatalinaConfigurationSettings +if [ -n "${CATALINA_PARAMETER1}" ]; then + processCatalinaConfigurationSettings +fi if [ -n "${CONFLUENCE_LOGFILE_LOCATION}" ]; then processConfluenceLogfileSettings