-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
68 lines (60 loc) · 3.66 KB
/
Dockerfile
File metadata and controls
68 lines (60 loc) · 3.66 KB
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
60
61
62
63
64
65
66
67
68
FROM openjdk:8
LABEL maintainer="Remon Lam <remon@containerstack.io>"
# Setup useful environment variables
ENV CONF_HOME /var/atlassian/confluence
ENV CONF_INSTALL /opt/atlassian/confluence
ENV JAVA_CACERTS $JAVA_HOME/jre/lib/security/cacerts
ENV CERTIFICATE $CONF_HOME/certificate
# Check Confluence version @ https://confluence.atlassian.com/doc/confluence-release-notes-327.html
ENV CONF_VERSION 7.0.2
# Check Connector/J version @ http://dev.mysql.com/downloads/connector/j/ it should be 5.1.30, testing with latest release
ENV MYSQL_CONJ_VERSION 5.1.42
# Install Atlassian Confluence and hepler 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 "${CONF_HOME}" \
&& chmod -R 700 "${CONF_HOME}" \
&& chown daemon:daemon "${CONF_HOME}" \
&& mkdir -p "${CONF_INSTALL}/conf" \
&& curl -Ls "https://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-${CONF_VERSION}.tar.gz" | tar -xz --directory "${CONF_INSTALL}" --strip-components=1 --no-same-owner \
&& curl -Ls "https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-${MYSQL_CONJ_VERSION}.tar.gz" | tar -xz --directory "${CONF_INSTALL}/confluence/WEB-INF/lib" --strip-components=1 --no-same-owner "mysql-connector-java-${MYSQL_CONJ_VERSION}/mysql-connector-java-${MYSQL_CONJ_VERSION}-bin.jar" \
&& chmod -R 700 "${CONF_INSTALL}/conf" \
&& chmod -R 700 "${CONF_INSTALL}/temp" \
&& chmod -R 700 "${CONF_INSTALL}/logs" \
&& chmod -R 700 "${CONF_INSTALL}/work" \
&& chown -R daemon:daemon "${CONF_INSTALL}/conf" \
&& chown -R daemon:daemon "${CONF_INSTALL}/temp" \
&& chown -R daemon:daemon "${CONF_INSTALL}/logs" \
&& chown -R daemon:daemon "${CONF_INSTALL}/work" \
&& echo -e "\nconfluence.home=$CONF_HOME" >> "${CONF_INSTALL}/confluence/WEB-INF/classes/confluence-init.properties" \
&& xmlstarlet ed --inplace \
--delete "Server/@debug" \
--delete "Server/Service/Connector/@debug" \
--delete "Server/Service/Connector/@useURIValidationHack" \
--delete "Server/Service/Connector/@minProcessors" \
--delete "Server/Service/Connector/@maxProcessors" \
--delete "Server/Service/Engine/@debug" \
--delete "Server/Service/Engine/Host/@debug" \
--delete "Server/Service/Engine/Host/Context/@debug" \
"${CONF_INSTALL}/conf/server.xml" \
&& touch -d "@0" "${CONF_INSTALL}/conf/server.xml" \
&& chown daemon:daemon "${JAVA_CACERTS}"
# 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:daemon
# Expose default HTTP connector port.
EXPOSE 8090
# 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/confluence", "/opt/atlassian/confluence/logs"]
# Set the default working directory as the Confluence home directory.
WORKDIR /var/atlassian/confluence
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
# Run Atlassian Confluence as a foreground process by default.
CMD ["/opt/atlassian/confluence/bin/catalina.sh", "run"]