Skip to content
Snippets Groups Projects
Commit d452d48b authored by zwindler's avatar zwindler
Browse files

RUN chown -R tomcat8:tomcat8 /var/lib/tomcat8 directive is extremely costly,...

RUN chown -R tomcat8:tomcat8 /var/lib/tomcat8 directive is extremely costly, adding a layers "changing" only the owner 230MB of data, thus adding 230 MB needlesly

Removing a few layers to correct this

Gained
parent e018df9f
No related branches found
No related tags found
No related merge requests found
......@@ -36,9 +36,14 @@ RUN echo "deb http://http.debian.net/debian jessie-backports main" > /etc/apt/so
rm -rf /var/lib/apt/lists/*
# Install XWiki as the ROOT webapp context in Tomcat
# Create the Tomcat temporary directory
# Configure the XWiki permanent directory
RUN rm -rf /var/lib/tomcat8/webapps/* && \
mkdir -p /var/lib/tomcat8/temp && \
mkdir -p /var/lib/xwiki && \
curl -L "http://download.forge.ow2.org/xwiki/xwiki-enterprise-web-${XWIKI_VERSION}.war" -o xwiki.war && \
unzip -d /var/lib/tomcat8/webapps/ROOT xwiki.war && \
chown -R tomcat8:tomcat8 /var/lib/tomcat8 /var/lib/xwiki && \
rm -f xwiki.war
# Download the MySQL JDBC driver and install it in the XWiki webapp
......@@ -52,24 +57,14 @@ RUN curl -L https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java
# Configure Tomcat. For example set the memory for the Tomcat JVM since the default value is too small for XWiki
COPY tomcat/setenv.sh /usr/share/tomcat8/bin/
# Create the Tomcat temporary directory
RUN mkdir -p /var/lib/tomcat8/temp
# Setup the XWiki Hibernate configuration
COPY xwiki/hibernate.cfg.xml /var/lib/tomcat8/webapps/ROOT/WEB-INF/hibernate.cfg.xml
# Configure the XWiki permanent directory
RUN mkdir -p /var/lib/xwiki
# Set a specific distribution id in XWiki for this docker packaging.
RUN sed "s/<id>org.xwiki.enterprise:xwiki-enterprise-web/<id>org.xwiki.enterprise:xwiki-enterprise-docker/" \
< /var/lib/tomcat8/webapps/ROOT/META-INF/extension.xed > /var/lib/tomcat8/webapps/ROOT/META-INF/extension2.xed && \
mv /var/lib/tomcat8/webapps/ROOT/META-INF/extension2.xed /var/lib/tomcat8/webapps/ROOT/META-INF/extension.xed
# Set ownership and permission to the tomcat8 user
RUN chown -R tomcat8:tomcat8 /var/lib/xwiki
RUN chown -R tomcat8:tomcat8 /var/lib/tomcat8
# Add scripts required to make changes to XWiki configuration files at execution time
COPY xwiki/xwiki-config-replace.sh /usr/local/bin/xwiki-config-replace.sh
COPY xwiki/xwiki-set-cfg /usr/local/bin/xwiki-set-cfg
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.