forked from seibert-media/docker-atlassian-jira-servicedesk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
59 lines (43 loc) · 2.08 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
54
55
56
57
58
59
##############################################################################
# Dockerfile to build Atlassian JIRA ServiceDesk container images
# Based on anapsix/alpine-java:8_server-jre
##############################################################################
FROM anapsix/alpine-java:8_server-jre
MAINTAINER //SEIBERT/MEDIA GmbH <[email protected]>
ARG VERSION
ENV JIRA_INST /opt/atlassian/jira
ENV JIRA_HOME /var/opt/atlassian/application-data/jira
ENV SYSTEM_USER jira
ENV SYSTEM_GROUP jira
ENV SYSTEM_HOME /home/jira
RUN set -x \
&& apk add git tar xmlstarlet wget ca-certificates --update-cache --allow-untrusted --repository http://dl-cdn.alpinelinux.org/alpine/edge/main --repository http://dl-cdn.alpinelinux.org/alpine/edge/community \
&& rm -rf /var/cache/apk/*
RUN set -x \
&& mkdir -p ${JIRA_INST} \
&& mkdir -p ${JIRA_HOME}
RUN set -x \
&& mkdir -p /home/${SYSTEM_USER} \
&& addgroup -S ${SYSTEM_GROUP} \
&& adduser -S -D -G ${SYSTEM_GROUP} -h ${SYSTEM_GROUP} -s /bin/sh ${SYSTEM_USER} \
&& chown -R ${SYSTEM_USER}:${SYSTEM_GROUP} /home/${SYSTEM_USER}
RUN set -x \
&& wget -nv -O /tmp/atlassian-servicedesk-${VERSION}.tar.gz https://www.atlassian.com/software/jira/downloads/binary/atlassian-servicedesk-${VERSION}.tar.gz \
&& tar xfz /tmp/atlassian-servicedesk-${VERSION}.tar.gz --strip-components=1 -C ${JIRA_INST} \
&& rm /tmp/atlassian-servicedesk-${VERSION}.tar.gz \
&& chown -R ${SYSTEM_USER}:${SYSTEM_GROUP} ${JIRA_INST} \
&& chown -R ${SYSTEM_USER}:${SYSTEM_GROUP} ${JIRA_HOME}
RUN set -x \
&& touch -d "@0" "${JIRA_INST}/conf/server.xml" \
&& touch -d "@0" "${JIRA_INST}/bin/setenv.sh" \
&& touch -d "@0" "${JIRA_INST}/atlassian-jira/WEB-INF/classes/jira-application.properties"
ADD files/service /usr/local/bin/service
ADD files/entrypoint /usr/local/bin/entrypoint
RUN set -x \
&& chown -R ${SYSTEM_USER}:${SYSTEM_GROUP} /usr/local/bin/service \
&& chown -R ${SYSTEM_USER}:${SYSTEM_GROUP} /usr/local/bin/entrypoint
EXPOSE 8080
USER ${SYSTEM_USER}
VOLUME ${JIRA_HOME}
ENTRYPOINT ["/usr/local/bin/entrypoint"]
CMD ["/usr/local/bin/service"]