Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Any way to pass JVM arguments to container? #3

Open
Wicaeed opened this issue May 11, 2016 · 3 comments
Open

Any way to pass JVM arguments to container? #3

Wicaeed opened this issue May 11, 2016 · 3 comments

Comments

@Wicaeed
Copy link

Wicaeed commented May 11, 2016

Hey there,

I'm getting started with docker and really like your project! I was wondering if you had any way to pass the JVM arguments (or any other argument in /opt/jira/bin/setenv.sh) to the container at start?

I tried to run it as docker run -d --name jira -p 8080:8080 -e JVM_MAXIMUM_MEMORY="2048m" --volumes-from jira_datstore atende/jira but I assume this doesn't work out of the box?

Right now the only way I can think to do it is bake the options into the setenv.sh after building a new docker image and commit the changes post-build, then make a new image.

@giovannicandido
Copy link
Member

Have you tried to use the JAVA_OPTS variable?

It is used by tomcat. Example:

export JAVA_OPTS="-Xms768m -Xmx1g"

or

docker run -e JAVA_OPTS="-Xms768m -Xmx1g"

@Wicaeed
Copy link
Author

Wicaeed commented May 27, 2016

It does seem to pass the argument properly, however you end up with a double declaration when java runs:
(passing arguments in Crane)

jira-test.local.lan:
    image: docker.local.lan/jira:7.1.7
    run:
      publish: ["8081:8080"]
      env:
       - "VIRTUAL_HOST=jira-test.local.lan"
       - "PROXY_SCHEME=https"
       - "PROXY_PORT=443"
       - "PROXY_SECURED=true"
       - "JAVA_OPTS=-Xms512m -Xmx768m"
      link: ["jira_test_db:jira_db"]
      volume: ["/data/jira_test_home:/opt/jira-home"]
      detach: true
\_ /opt/jdk/bin/java -Djava.util.logging.config.file=/opt/jira/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xms384m -Xmx768m -Xms512m -Xmx768m -Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Dorg.dom4j.factory=com.atlassian.core.xml.InterningDocumentFactory -XX:+PrintGCDateStamps -XX:-OmitStackTraceInFastThrow -Djava.endorsed.dirs=/opt/jira/endorsed -classpath /opt/jira/bin/bootstrap.jar:/opt/jira/bin/tomcat-juli.jar -Dcatalina.base=/opt/jira -Dcatalina.home=/opt/jira -Djava.io.tmpdir=/opt/jira/temp org.apache.catalina.startup.Bootstrap start

@giovannicandido
Copy link
Member

giovannicandido commented May 30, 2016

I guess the install script should edit the setenv.sh in the bin of jira, to accommodate existing JAVA_OPTS env variable, or provide a way to override the JAVA_OPTS in the file. But I'm commenting without looking :-)

I will check that latter.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants