teamatldocker / confluence

Dockerized Atlassian Confluence
https://hub.docker.com/r/teamatldocker/confluence/
MIT License
301 stars 147 forks source link

Wrong entrypoint behavior for CATALINA_PARAMETER$i #33

Closed Deroin closed 6 years ago

Deroin commented 6 years ago

When starting the container with parameters like -e "CATALINA_PARAMETER1=-Xms" -e "CATALINA_PARAMETER_VALUE1=1024m" the entrypoint exits the configuration method in line 140 as $i is set to 1 when entering the method and CATALINA_PARAMETER1 is not empty.

This happens since i is set to 1 in line 84 and never incremented there.

As a workaround dummy CONFLUENCE_CONFIG_PROPERTY1 parameter needs to be set as environment variable to a non empty string. When multiple catalina parameters should be used the same amount of confluence config properties needs to exist in order for the configuration method not to exit prematurely.

blacklabelops commented 6 years ago

Problem with variable scopes. Both functions use a counter with a global scope.

Can you give me an example so I can retest my solution?

Deroin commented 6 years ago

I experienced this when using the example on setting catalina memory as you described in your readme:

$ docker run -d -p 80:8090 \
    --name confluence \
    -e "CATALINA_PARAMETER1=-Xms" \
      -e "CATALINA_PARAMETER_VALUE1=1024m" \
    -e "CATALINA_PARAMETER2=-Xmx" \
      -e "CATALINA_PARAMETER_VALUE2=2048m" \
    blacklabelops/confluence

The method for handling catalina parameters is entered with this one but fails the mentioned condition die to i being 1.

blacklabelops commented 6 years ago

Reverted the last commit!