renamed env variable to be slightly longer

This commit is contained in:
Joe Xie 2016-05-26 14:31:55 +10:00
parent e348d361a5
commit 294265549d

View File

@ -2,8 +2,8 @@ FROM java:openjdk-8-jre
MAINTAINER Atlassian Confluence MAINTAINER Atlassian Confluence
# Setup useful environment variables # Setup useful environment variables
ENV CONF_HOME /var/atlassian/confluence-home ENV CONFLUENCE_HOME /var/atlassian/confluence-home
ENV CONF_INSTALL /opt/atlassian/confluence ENV CONFLUENCE_INSTALL /opt/atlassian/confluence
ENV CONF_VERSION 5.9.11 ENV CONF_VERSION 5.9.11
LABEL Description="This image is used to start Atlassian Confluence" Vendor="Atlassian" Version="${CONF_VERSION}" LABEL Description="This image is used to start Atlassian Confluence" Vendor="Atlassian" Version="${CONF_VERSION}"
@ -26,21 +26,21 @@ RUN set -x \
&& apt-get update --quiet \ && apt-get update --quiet \
&& apt-get install --quiet --yes --no-install-recommends libtcnative-1 xmlstarlet \ && apt-get install --quiet --yes --no-install-recommends libtcnative-1 xmlstarlet \
&& apt-get clean \ && apt-get clean \
&& mkdir -p "${CONF_HOME}" \ && mkdir -p "${CONFLUENCE_HOME}" \
&& chmod -R 700 "${CONF_HOME}" \ && chmod -R 700 "${CONFLUENCE_HOME}" \
&& chown ${RUN_USER}:${RUN_GROUP} "${CONF_HOME}" \ && chown ${RUN_USER}:${RUN_GROUP} "${CONFLUENCE_HOME}" \
&& mkdir -p "${CONF_INSTALL}/conf" \ && mkdir -p "${CONFLUENCE_INSTALL}/conf" \
&& curl -Ls "${CONFLUENCE_DOWNLOAD_URL}" | tar -xz --directory "${CONF_INSTALL}" --strip-components=1 --no-same-owner \ && curl -Ls "${CONFLUENCE_DOWNLOAD_URL}" | tar -xz --directory "${CONFLUENCE_INSTALL}" --strip-components=1 --no-same-owner \
&& curl -Ls "${MYSQL_DRIVER_DOWNLOAD_URL}" | tar -xz --directory "${CONF_INSTALL}/confluence/WEB-INF/lib" --strip-components=1 --no-same-owner "mysql-connector-java-${MYSQL_VERSION}/mysql-connector-java-${MYSQL_VERSION}-bin.jar" \ && curl -Ls "${MYSQL_DRIVER_DOWNLOAD_URL}" | tar -xz --directory "${CONFLUENCE_INSTALL}/confluence/WEB-INF/lib" --strip-components=1 --no-same-owner "mysql-connector-java-${MYSQL_VERSION}/mysql-connector-java-${MYSQL_VERSION}-bin.jar" \
&& chmod -R 700 "${CONF_INSTALL}/conf" \ && chmod -R 700 "${CONFLUENCE_INSTALL}/conf" \
&& chmod -R 700 "${CONF_INSTALL}/temp" \ && chmod -R 700 "${CONFLUENCE_INSTALL}/temp" \
&& chmod -R 700 "${CONF_INSTALL}/logs" \ && chmod -R 700 "${CONFLUENCE_INSTALL}/logs" \
&& chmod -R 700 "${CONF_INSTALL}/work" \ && chmod -R 700 "${CONFLUENCE_INSTALL}/work" \
&& chown -R ${RUN_USER}:${RUN_GROUP} "${CONF_INSTALL}/conf" \ && chown -R ${RUN_USER}:${RUN_GROUP} "${CONFLUENCE_INSTALL}/conf" \
&& chown -R ${RUN_USER}:${RUN_GROUP} "${CONF_INSTALL}/temp" \ && chown -R ${RUN_USER}:${RUN_GROUP} "${CONFLUENCE_INSTALL}/temp" \
&& chown -R ${RUN_USER}:${RUN_GROUP} "${CONF_INSTALL}/logs" \ && chown -R ${RUN_USER}:${RUN_GROUP} "${CONFLUENCE_INSTALL}/logs" \
&& chown -R ${RUN_USER}:${RUN_GROUP} "${CONF_INSTALL}/work" \ && chown -R ${RUN_USER}:${RUN_GROUP} "${CONFLUENCE_INSTALL}/work" \
&& echo -e "\nconfluence.home=$CONF_HOME" >> "${CONF_INSTALL}/confluence/WEB-INF/classes/confluence-init.properties" \ && echo -e "\nconfluence.home=${CONFLUENCE_HOME}" >> "${CONFLUENCE_INSTALL}/confluence/WEB-INF/classes/confluence-init.properties" \
&& xmlstarlet ed --inplace \ && xmlstarlet ed --inplace \
--delete "Server/@debug" \ --delete "Server/@debug" \
--delete "Server/Service/Connector/@debug" \ --delete "Server/Service/Connector/@debug" \
@ -50,8 +50,8 @@ RUN set -x \
--delete "Server/Service/Engine/@debug" \ --delete "Server/Service/Engine/@debug" \
--delete "Server/Service/Engine/Host/@debug" \ --delete "Server/Service/Engine/Host/@debug" \
--delete "Server/Service/Engine/Host/Context/@debug" \ --delete "Server/Service/Engine/Host/Context/@debug" \
"${CONF_INSTALL}/conf/server.xml" \ "${CONFLUENCE_INSTALL}/conf/server.xml" \
&& touch -d "@0" "${CONF_INSTALL}/conf/server.xml" && touch -d "@0" "${CONFLUENCE_INSTALL}/conf/server.xml"
# Use the default unprivileged account. This could be considered bad practice # Use the default unprivileged account. This could be considered bad practice
# on systems where multiple processes end up being executed by 'daemon' but # on systems where multiple processes end up being executed by 'daemon' but
@ -64,10 +64,10 @@ EXPOSE 8090
# Set volume mount points for installation and home directory. Changes to the # 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 # home directory needs to be persisted as well as parts of the installation
# directory due to eg. logs. # directory due to eg. logs.
VOLUME ["${CONF_INSTALL}", "${CONF_HOME}"] VOLUME ["${CONFLUENCE_INSTALL}", "${CONFLUENCE_HOME}"]
# Set the default working directory as the Confluence home directory. # Set the default working directory as the Confluence installation directory.
WORKDIR ${CONF_INSTALL} WORKDIR ${CONFLUENCE_INSTALL}
# Run Atlassian Confluence as a foreground process by default. # Run Atlassian Confluence as a foreground process by default.
CMD ["./bin/catalina.sh", "run"] CMD ["./bin/catalina.sh", "run"]