How to run Jira in a docker container

Everything below is tested on Ubuntu 17.10.

I prefer to use Jira in a docker container because:

1. I can install Jira with a couple of commands.

2. I can start and stop Jira just by starting and stopping containers.

3. I can easily delete any Jira, which I do not need.

4. I do not make my folder structure "messy" with all kinds of jira folders.

5. I can see all Jira instances, that I am currently running, with a single command.

If to sum up all the above, docker containers make my life easier to control all available Jira instances on my pc.

If you search in google for Jira docker, then you will find the following page:

https://hub.docker.com/r/cptactionhank/atlassian-jira/

This image is not supported by Atlassian, that is why use it wisely and kindly read the Contributions part of the main page for the docker image. I use this image in my notebook for research. If you want to use it not for research, kindly test the image first.

The command, which will let you run this container, is defined like this:

docker run --detach --publish 8080:8080 cptactionhank/atlassian-jira:latest

The problem with the Jira container is:

1. Jira does not have internet access, that is why you will not be able to install plugins from the Jira UI.

2. You can not access Jira Home folder, where the logs, indexes, plugin configurations are. For example, if you have the ScriptRunner plugin, then you will not be able to work with the script folder, which is placed in the Jira Home folder.

You will be able to see the Jira logs though, if you attach to the docker container by the docker attach command.

That is why I prefer to run Jira in a docker container the following way:

1. Create a volume where all files from the Jira Home folder will be stored.

docker volume create jirahome

you can see, where the created volume is in your file system, with the following command:

docker volume inspect jirahome

 The output will be like this:

 

Selection_025.png

2. Run Jira docker container.

docker run --detach --net host --mount source=jira78,destination=/var/atlassian/jira --publish 8080:8080 cptactionhank/atlassian-jira:latest

After that you can launch your Jira in localhost:8080. Your Jira will have internet access and you can see all files of the Jira Home folder in your local filesystem.

11 comments

Great - I love this Article.

I would recommend against using that specific docker image of Jira.   Mostly because it's using openjdk, a java platform that Jira Server does not support.   I'm not completely opposed to using docker, I just think it might be unwise to advise users to follow this guide when they don't understand the installation decisions made by the image creator.

Alexey Matveev Community Champion Mar 19, 2018

@Andrew Heinzer Thank you Andrew. I added the following part to the article:

This image is not supported by Atlassian, that is why use it wisely and kindly read the Contributions part of the main page for the docker image. I use this image in my notebook for research. If you want to use it not for research, kindly test the image first.

This is awesome @Alexey Matveev

Thanks a lot!

Hello @Andrew Heinzer,

That's why I created an image with Oracle JDK :) and legal license.

You can find it there : https://hub.docker.com/r/frogbis/jira-software/

You can enjoy it :)

Regards,

Franck

You might also have a look at the atlassian docker builder which allows you to build docker images for any atlassian application.

It is open source and available here

We created a blog to show how it is being used
https://www.idalko.com/atlassian-jira-upgrade-journey-using-docker-and-the-atlassian-docker-builder/

 

We are using it extensively to deploy jira, confluence, bamboo, ... 

It helps us a lot whenever testing for instance Exalate.  This issue synchronisation addon is requiring a lot of Jira's  and without the docker approach we would never be able to test it properly (in an automated way)

 

Hope this helps

 

Francis

Great stuff! We are also using docker images for quick testing.


It is worth mentioning that Atlassian have official account with available docker images of some products like Confluence: Official Confluence Server image

The thing I don't understand about the various Jira containers I've seen is how they persist the data. I know that at the least we need to persist the Jira home and database, but none of the examples I've looked at seem to do that. ???

I wish the atlassian-docker-builder was still maintained in a way that would let me post issues.. I'm having .. issues with it, and no really good place to ask for feedback to solve them, so I'm currently building the official images myself.

There are two forks of it, but none seem to include any changes/improvements so far.

@Scott Thomason (scott8035)

The Jira container uses docker volumes to persist data. The cptaction image uses two volumes, one for the confluence home directory and another for the <confluence installation>/logs directory. As for the database, that is not inside the container; it has to be set up separately. If you don't specify a volume name in the run command, the image will automatically create anonymous (unnamed) volumes. It makes updates a lot easier if you create a volume ahead of time and mount it to the container using the --volume or --mount option in the run command as described in this article.

You can learn more about volumes here:

https://docs.docker.com/storage/volumes/

Good job! We actually have been running Jira in container for quite a while. And it works perfectly fine. Just a fews more things that I want to share:

1) Performance wise it is better have a volume for log as well, it is located at <jira_install_path>/logs.

2) Enable JMX, as it is in container. so 127.0.0.1 does not work, you have to use the host IP.

Comment

Log in or Sign up to comment
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

25,386 views 2 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you