forked from teamatldocker/confluence
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
107 lines (100 loc) · 6.13 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
FROM blacklabelops/java:server-jre.8
MAINTAINER Steffen Bleul <[email protected]>
ARG CONFLUENCE_VERSION=6.4.1
# permissions
ARG CONTAINER_UID=1000
ARG CONTAINER_GID=1000
# Image Build Date By Buildsystem
ARG BUILD_DATE=undefined
# Language Settings
ARG LANG_LANGUAGE=en
ARG LANG_COUNTRY=US
# Setup useful environment variables
ENV CONF_HOME=/var/atlassian/confluence \
CONF_INSTALL=/opt/atlassian/confluence \
MYSQL_DRIVER_VERSION=5.1.44
# Install Atlassian Confluence
RUN export CONTAINER_USER=confluence && \
export CONTAINER_GROUP=confluence && \
addgroup -g $CONTAINER_GID $CONTAINER_GROUP && \
adduser -u $CONTAINER_UID \
-G $CONTAINER_GROUP \
-h /home/$CONTAINER_USER \
-s /bin/bash \
-S $CONTAINER_USER && \
apk add --update \
ca-certificates \
gzip \
curl \
tar \
xmlstarlet \
msttcorefonts-installer \
ttf-dejavu \
fontconfig \
ghostscript \
graphviz \
motif \
wget && \
# Installing true type fonts
update-ms-fonts && \
fc-cache -f && \
# Setting Locale
/usr/glibc-compat/bin/localedef -i ${LANG_LANGUAGE}_${LANG_COUNTRY} -f UTF-8 ${LANG_LANGUAGE}_${LANG_COUNTRY}.UTF-8 && \
# Installing Confluence
mkdir -p ${CONF_HOME} \
&& chown -R confluence:confluence ${CONF_HOME} \
&& mkdir -p ${CONF_INSTALL}/conf \
&& wget -O /tmp/atlassian-confluence-${CONFLUENCE_VERSION}.tar.gz http://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-${CONFLUENCE_VERSION}.tar.gz && \
tar xzf /tmp/atlassian-confluence-${CONFLUENCE_VERSION}.tar.gz --strip-components=1 -C ${CONF_INSTALL} && \
echo "confluence.home=${CONF_HOME}" > ${CONF_INSTALL}/confluence/WEB-INF/classes/confluence-init.properties && \
# Install database drivers
rm -f \
${CONF_INSTALL}/lib/mysql-connector-java*.jar && \
wget -O /tmp/mysql-connector-java-${MYSQL_DRIVER_VERSION}.tar.gz \
http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-${MYSQL_DRIVER_VERSION}.tar.gz && \
tar xzf /tmp/mysql-connector-java-${MYSQL_DRIVER_VERSION}.tar.gz \
-C /tmp && \
cp /tmp/mysql-connector-java-${MYSQL_DRIVER_VERSION}/mysql-connector-java-${MYSQL_DRIVER_VERSION}-bin.jar \
${CONF_INSTALL}/lib/mysql-connector-java-${MYSQL_DRIVER_VERSION}-bin.jar && \
chown -R confluence:confluence ${CONF_INSTALL} && \
# Adding letsencrypt-ca to truststore
export KEYSTORE=$JAVA_HOME/jre/lib/security/cacerts && \
wget -P /tmp/ https://letsencrypt.org/certs/letsencryptauthorityx1.der && \
wget -P /tmp/ https://letsencrypt.org/certs/letsencryptauthorityx2.der && \
wget -P /tmp/ https://letsencrypt.org/certs/lets-encrypt-x1-cross-signed.der && \
wget -P /tmp/ https://letsencrypt.org/certs/lets-encrypt-x2-cross-signed.der && \
wget -P /tmp/ https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.der && \
wget -P /tmp/ https://letsencrypt.org/certs/lets-encrypt-x4-cross-signed.der && \
keytool -trustcacerts -keystore $KEYSTORE -storepass changeit -noprompt -importcert -alias isrgrootx1 -file /tmp/letsencryptauthorityx1.der && \
keytool -trustcacerts -keystore $KEYSTORE -storepass changeit -noprompt -importcert -alias isrgrootx2 -file /tmp/letsencryptauthorityx2.der && \
keytool -trustcacerts -keystore $KEYSTORE -storepass changeit -noprompt -importcert -alias letsencryptauthorityx1 -file /tmp/lets-encrypt-x1-cross-signed.der && \
keytool -trustcacerts -keystore $KEYSTORE -storepass changeit -noprompt -importcert -alias letsencryptauthorityx2 -file /tmp/lets-encrypt-x2-cross-signed.der && \
keytool -trustcacerts -keystore $KEYSTORE -storepass changeit -noprompt -importcert -alias letsencryptauthorityx3 -file /tmp/lets-encrypt-x3-cross-signed.der && \
keytool -trustcacerts -keystore $KEYSTORE -storepass changeit -noprompt -importcert -alias letsencryptauthorityx4 -file /tmp/lets-encrypt-x4-cross-signed.der && \
# Install atlassian ssl tool
wget -O /home/${CONTAINER_USER}/SSLPoke.class https://confluence.atlassian.com/kb/files/779355358/779355357/1/1441897666313/SSLPoke.class && \
chown -R confluence:confluence /home/${CONTAINER_USER} && \
# Remove obsolete packages and cleanup
apk del wget && \
# Clean caches and tmps
rm -rf /var/cache/apk/* && \
rm -rf /tmp/* && \
rm -rf /var/log/*
# Image Metadata
LABEL com.blacklabelops.application.confluence.version=$CONFLUENCE_VERSION \
com.blacklabelops.application.confluence.setting.language=$LANG_LANGUAGE \
com.blacklabelops.application.confluence.setting.country=$LANG_COUNTRY \
com.blacklabelops.application.confluence.userid=$CONTAINER_UID \
com.blacklabelops.application.confluence.groupid=$CONTAINER_GID \
com.blacklabelops.application.version.jdbc-mysql=$MYSQL_DRIVER_VERSION \
com.blacklabelops.application.version.jdbc-postgres=$POSTGRESQL_DRIVER_VERSION \
com.blacklabelops.image.builddate.confluence=${BUILD_DATE}
# Expose default HTTP connector port.
EXPOSE 8090 8091
USER confluence
VOLUME ["/var/atlassian/confluence"]
# Set the default working directory as the Confluence home directory.
WORKDIR ${CONF_HOME}
COPY docker-entrypoint.sh /home/confluence/docker-entrypoint.sh
ENTRYPOINT ["/sbin/tini","--","/home/confluence/docker-entrypoint.sh"]
CMD ["confluence"]