Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control the JVM memory in Dockerfile #109

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ ENV JIRA_HOME /var/atlassian/jira
ENV JIRA_INSTALL /opt/atlassian/jira
ENV JIRA_VERSION 9.0.0

# If you need to override Jira's default memory allocation, you can control the minimum heap (Xms) and maximum heap (Xmx) via the below environment variables.
ENV JVM_MINIMUM_MEMORY 384
ENV JVM_MAXIMUM_MEMORY 768

# Install Atlassian JIRA and helper tools and setup initial home
# directory structure.
RUN set -x \
Expand All @@ -28,7 +32,9 @@ RUN set -x \
&& chown -R daemon:daemon "${JIRA_INSTALL}/work" \
&& sed --in-place "s/java version/openjdk version/g" "${JIRA_INSTALL}/bin/check-java.sh" \
&& echo -e "\njira.home=$JIRA_HOME" >> "${JIRA_INSTALL}/atlassian-jira/WEB-INF/classes/jira-application.properties" \
&& touch -d "@0" "${JIRA_INSTALL}/conf/server.xml"
&& touch -d "@0" "${JIRA_INSTALL}/conf/server.xml" \
&& sed -i -Ee 's/^[\s#]*(JVM_MINIMUM_MEMORY[\s]*=).+$/\1"'${JVM_MINIMUM_MEMORY}'m"/' ${JIRA_INSTALL}/bin/setenv.sh \
&& sed -i -Ee 's/^[\s#]*(JVM_MAXIMUM_MEMORY[\s]*=).+$/\1"'${JVM_MAXIMUM_MEMORY}'m"/' ${JIRA_INSTALL}/bin/setenv.sh

# Use the default unprivileged account. This could be considered bad practice
# on systems where multiple processes end up being executed by 'daemon' but
Expand Down