docker-atlassian-jira-software
docker-atlassian-jira-software copied to clipboard
How to override default volume settings (jira-software)?
Hi, I'm trying to get the cptactionhank/docker-atlassian-jira-software image to run with customized volumes with a persistent location on the host (i.e. not those default volumes that get a new id and subdir every time I start an instance). I only want to run one docker-jira-software container anyway, but need to keep the configuration even if I remove the container and create a new one (e.g. for software updates). With my postgresql container, this works without problems, but I can't get it to work with the jira software container.
I first startet the container with this command:
docker run -d --name jirasw -v /docker/data/jira-sw-logs:/opt/atlassian/jira/logs:rw -v /docker/data/jira-sw-var:/var/atlassian/jira:rw -p 8080:8080 --link jiradb:db cptactionhank/atlassian-jira-software
but could not use the container because jira complained about missing files in /var/atlassian/jira. Now, I'm running it via
docker run -d --name jirasw -v /docker/data/jira-sw-logs:/opt/atlassian/jira/logs:rw -v /docker/data/jira-sw-var:/var/atlassian:rw -p 8080:8080 --link jiradb:db cptactionhank/atlassian-jira-software
which installed fine - but /docker/data/jira-sw-var now only contains an empty directory
jira
and the actual data is in /var/lib/docker/volumes/57739b108ac98ebdda3706ff566dd25c04600da14803d03b5a8c985ec802f535/_data.
I'm sure I'm making a mistake here (I've been managing linux machines for 20 years now, but am relatively new to docker) - but can anyone tell me which one?
I have now copied the files from the anoymous volume to my named one, and then stopped, removed and restarted a jira-software container with the same settings as above. But the files don't appear inside the container, and the web server prompts me to reinstall Jira-software from scratch :-(
How can I get a setup with a persistent JIRA which doesn't prompt me to reinstall everything every time builld a new container? I thought I understood how this works, but clearly I haven't understood anything.
It seems like the server configuration xml file located in the JIRA home directory could not be read, make sure that the ownership of the copied files in the container is as expected.
If the old container is still running, you should try and use docker cp
rather than going behind the curtains and extracting the files directly.
Try and
- extract the home directory from the old container to a known directory on your host
- make a backup of this directory, make sure the content is as expected (ie. essential lira configuration files)
- boot up a new container with the containers jira home mounted to you copy on the host machine
- use
docker exec -ti -u 0 XXXXXX bash
to get a shell and verify permissions are correct - visit the containers web and see if JIRA has picked it up
I have managed to get this running. Something related that I struggled with was not being able to edit the /opt/atlassian/jira/conf/server.xml file to add proxyName,proxyPort and scheme to the connector configuration to enable me to run the instance behind https://jira.somedomain.com
There is no vim installed in the container to edit this with. if the whole /opt/atlassian/jira directory could be part of the volume it would have helped me heaps. instead I have to cp copy the file out, edit it and cp copy it back in. then if i remove the contained and start again I have to do this all over again.
suppose I can submit a pull request to the docker file or is there a reason why only the /opt/atlassian/jira/logs folder is added as a volume?
proxyName,proxyPort and scheme to the connector can be added by supplying environment variables
@LouwMarais Try to edit with vi.