cptactionhank / docker-atlassian-jira-software

Atlassian JIRA Software wrapped in a Docker image
https://cptactionhank.github.io/docker-atlassian-jira-software
MIT License
267 stars 165 forks source link

How to override default volume settings (jira-software)? #31

Open blavov opened 6 years ago

blavov commented 6 years ago

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?

blavov commented 6 years ago

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.

cptactionhank commented 6 years ago

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

LouwMarais commented 6 years ago

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?

cptactionhank commented 6 years ago

proxyName,proxyPort and scheme to the connector can be added by supplying environment variables

arruah commented 6 years ago

@LouwMarais Try to edit with vi.