Skip to content
Snippets Groups Projects
Name Last commit Last update
Dockerfile
README.md
init.sh

JIRA

Docker image to run Atlassian JIRA.

Building

docker build --rm -t registry.codemate.se/jira .

Usage

It's as simple as:

docker pull registry.codemate.se/jira
docker run -d registry.codemate.se/jira

Customize exposed port

By default, the port 8080 (web interface) is mapped to a random port on the docker host. To customize, run:

docker run -p 8080:8080 -d registry.codemate.se/jira

More info about port redirection can be found in the official Docker documentation.

Persist application data on the docker host

By default the application data is stored in the container in /home/jira. You can map a directory on the host to this directory to store the application data outside of the container.

This is useful if you want to start containers using different versions of the image but with the same application data (including license) or if you want to backup this directory on the host. It also allows you to upgrade your server without losing your data:

docker run -v /data/jira:/home/jira -d registry.codemate.se/jira

Running a different JIRA version

By default, the container downloads and installs JIRA v6.3.1 on the first boot. To specify which version to install, set the environment variable JIRA_VERSION:

docker run -e JIRA_VERSION=6.3.1 -d registry.codemate.se/jira

Overriding JIRA files

By providing an environment variable name JIRA_OVERLAY that points to a gzipped tar file you can apply an overlay on the JIRA installation. This tarball will be unzipped and extracted in the root of the JIRA installation directory. The overlay enables you to add custom jira configurations such as SSL or Crowd integration.

docker run -e JIRA_OVERLAY=http://10.0.0.1/jira-config.tgz -d registry.codemate.se/jira

The overlay is fetched using curl so if you need to provide basic auth credentials simply prefix the url with the credentials, for example:

JIRA_OVERLAY="-u username:password http://10.0.0.1/jira-config.tgz"

Initializing MySQL

By providing an environment variable name MYSQL_INIT that points to an SQL script you initialize the MySQL database.

docker run -e MYSQL_INIT=http://10.0.0.1/jira-init.sql -d registry.codemate.se/jira

Basic auth credentials can be used as mentioned in the JIRA overlay section.

Combined options

The following example shows the options we use for our CI environment:

docker run \
  --name jira \
  -e JAVA_OPTS=-Xmx1024m \
  -e JIRA_VERSION=6.3.1 \
  -e JIRA_OVERLAY=http://10.0.0.1/jira-config.tgz \
  -v /opt/application-data/jira:/home/jira \
  -p 8080:8080 \
  -p 8081:8081 \
  -d registry.codemate.se/jira

Directories

  • /opt/atlassian-jira-$JIRA_VERSION-standalone - JIRA installation directory
  • /home/jira - JIRA home directory (JIRA_HOME)

Variables

  • JIRA_HOME - JIRA home directory (default /home/jira)
  • JIRA_VERSION - The version to install an run (default 6.3.1)
  • JIRA_OVERLAY - A URL pointing to an tarball overlay
  • MYSQL_INIT - A URL pointing to an SQL script

Exposed ports

  • 25 - Exim SMTP
  • 3306 - MySQL
  • 8080 - JIRA web interface
  • 8081 - JIRA web interface (extra)