- Problem
- Mac
- 1.12.6
- Trying to run the following Dockerfile
Hi! I am struggling a bit with containers and entrypoint. I am trying to add an entrypoint to a standard tomcatcontainer. When I do, tomcat never starts. This is the Dockerfile
FROM tomcat:8.5.9-jre8
MAINTAINER Robert Myhren myhren@gmail.com
ENV MYSQL_URL jdbc:mysql://localhost/xwiki?useSSL=false
ENV MYSQL_USER xwiki
ENV MYSQL_PASS xwiki
RUN rm -rf webapps/* &&
curl -L
‘http://download.forge.ow2.org/xwiki/xwiki-enterprise-web-8.4.4.war’
-o xwiki.war &&
unzip -d webapps/ROOT xwiki.war &&
rm -f xwiki.war
RUN curl -L
‘http://central.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/1.5.4/mariadb-java-client-1.5.4.jar’
-o ‘webapps/ROOT/WEB-INF/lib/mariadb-java-client-1.5.4.jar’
COPY setenv.sh bin/
COPY catalina.policy conf/catalina.policy
EXPOSE 8080
VOLUME ["/usr/local/tomcat/webapps/ROOT/WEB-INF", “/var/local/xwiki”]
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT [“docker-entrypoint.sh”]
, and this is the entrypoint file
#!/bin/bash
sed -ie ‘s_.environment.permanentDirectory.environment.permanentDirectory=/var/local/xwiki’ webapps/ROOT/WEB-INF/xwiki.properties
sed -ie “s_.connection.url.${MYSQL_URL}” webapps/ROOT/WEB-INF/hibernate.cfg.xml
sed -ie “s_.connection.username.${MYSQL_USER}” webapps/ROOT/WEB-INF/hibernate.cfg.xml
sed -ie “s_.connection.password.${MYSQL_PASS}” webapps/ROOT/WEB-INF/hibernate.cfg.xml
exec “$@”