1

I am trying to create a docker build for libreplan, using the install instructions here. The dockerfile is

FROM tomcat:6

RUN apt-get -yq update && apt-get -yq install \
  cutycapt \
  patch \
  postgresql-client \
  libpg-java \
  xvfb

# Prepare webapp location
RUN mkdir -p /usr/local/tomcat/webapps/libreplan
# Get WAR file
RUN wget -q -O /usr/local/tomcat/webapps/libreplan/libreplan.war http://downloads.sourceforge.net/project/libreplan/LibrePlan/libreplan_1.3.0.war
# Install libreplan.xml
ADD libreplan.xml /usr/local/tomcat/webapps/libreplan/libreplan.xml
# Patch the policy to include libreplan
ADD catalina.policy.patch catalina.policy.patch
RUN patch -o /usr/local/tomcat/conf/catalina.policy /usr/local/tomcat/conf/catalina.policy catalina.policy.patch

CMD ["catalina.sh", "run"]

The build works but doesn't do anything when I try to run it. All the code is on github and I have set up an automated build on the docker registry. Included in the repo is a sample docker-compose.yml which should work, but when I try it no output is shown from the libreplan container and I can't access it through a browser. I don't know tomcat at all so it is probably something that I have done wrong, but I don't know how to even start figuring out what. Is there anything obvious that I have missed?

aquavitae
  • 17,414
  • 11
  • 63
  • 106

2 Answers2

0

If I run your image:

$ docker run --name libreplan aquavitae/libreplan

I get:

May 28, 2015 4:57:42 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
May 28, 2015 4:57:42 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
May 28, 2015 4:57:42 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 387 ms
May 28, 2015 4:57:42 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
May 28, 2015 4:57:42 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.44
May 28, 2015 4:57:42 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory host-manager
May 28, 2015 4:57:42 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory manager
May 28, 2015 4:57:42 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
May 28, 2015 4:57:42 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory libreplan
May 28, 2015 4:57:42 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
May 28, 2015 4:57:42 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
May 28, 2015 4:57:42 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
May 28, 2015 4:57:42 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
May 28, 2015 4:57:42 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/12  config=null
May 28, 2015 4:57:42 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 580 ms

Which seems entirely successful. Furthermore, I can grab the ip address of the container:

$ docker inspect --format '{{ .NetworkSettings.IPAddress }}' libreplan
172.17.0.9

And the open that in a browser:

$ firefox http://172.17.0.9:8080

And see the default Tomcat web page.

So mostly it seems to work.

I can also docker up things without error, although I replaced the build: . line with image: aquavitae/libreplan because I wasn't patient enough to try the build.

larsks
  • 277,717
  • 41
  • 399
  • 399
  • Weird, I just tried rebuilding locally and it worked - maybe a caching issue. However, the actual webapp still doesn't seem to be accessible. Any idea what I've done wrong with installing it into tomcat? – aquavitae May 29 '15 at 05:15
  • That's more of a Tomcat issue, and I'm not particularly familar with Tomcat. – larsks May 29 '15 at 12:46
-1

OK in this situation you have to troubleshoot by running a shell in the container and starting up the process manually. If you're lucky docker logs containername may have enough information for you to understand what's wrong, but usually I end up having to get into the container as follows:

docker run --interactive --tty --link db:db <containerid> bash

Once in, you,ll want to run your CMD directly.

catalina.sh run

Looking at your file, my first thought would be catalina.sh is not in your PATH or not executable. So you would fix that by running /bin/sh /full/path/to/catalina.sh run, or adjusting your PATH environment variable and/or using the WORKDIR directive in your Dockerfile.

Peter Lyons
  • 142,938
  • 30
  • 279
  • 274