forked from cptactionhank/docker-atlassian-jira-software
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
53 lines (45 loc) · 2.61 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM java:8
# Configuration variables.
ENV JIRA_HOME /var/atlassian/jira
ENV JIRA_INSTALL /opt/atlassian/jira
ENV JIRA_VERSION 7.2.7
# Install Atlassian JIRA and helper tools and setup initial home
# directory structure.
RUN set -x \
&& apt-get update --quiet \
&& apt-get install --quiet --yes --no-install-recommends libtcnative-1 xmlstarlet \
&& apt-get clean \
&& mkdir -p "${JIRA_HOME}" \
&& mkdir -p "${JIRA_HOME}/caches/indexes" \
&& chmod -R 770 "${JIRA_HOME}" \
&& chown -R 0:0 "${JIRA_HOME}" \
&& mkdir -p "${JIRA_INSTALL}/conf/Catalina" \
&& curl -Ls "https://www.atlassian.com/software/jira/downloads/binary/atlassian-jira-software-7.2.7.tar.gz" | tar -xz --directory "${JIRA_INSTALL}" --strip-components=1 --no-same-owner \
&& curl -Ls "https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.38.tar.gz" | tar -xz --directory "${JIRA_INSTALL}/lib" --strip-components=1 --no-same-owner "mysql-connector-java-5.1.38/mysql-connector-java-5.1.38-bin.jar" \
&& chmod -R 770 "${JIRA_INSTALL}/conf" \
&& chmod -R 770 "${JIRA_INSTALL}/logs" \
&& chmod -R 770 "${JIRA_INSTALL}/temp" \
&& chmod -R 770 "${JIRA_INSTALL}/work" \
&& chown -R 0:0 "${JIRA_INSTALL}/conf" \
&& chown -R 0:0 "${JIRA_INSTALL}/logs" \
&& chown -R 0:0 "${JIRA_INSTALL}/temp" \
&& chown -R 0:0 "${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"
# Use the default unprivileged account. This could be considered bad practice
# on systems where multiple processes end up being executed by 'daemon' but
# here we only ever run one process anyway.
USER daemon:root
# Expose default HTTP connector port.
EXPOSE 8080
# Set volume mount points for installation and home directory. Changes to the
# home directory needs to be persisted as well as parts of the installation
# directory due to eg. logs.
VOLUME ["/var/atlassian/jira", "/opt/atlassian/jira/logs"]
# Set the default working directory as the installation directory.
WORKDIR /var/atlassian/jira
COPY "docker-entrypoint.sh" "/"
ENTRYPOINT ["/docker-entrypoint.sh"]
# Run Atlassian JIRA as a foreground process by default.
CMD ["/opt/atlassian/jira/bin/catalina.sh", "run"]