Start Tomcat 8 in docker image

We use startext/oracle-jdk-8 container which is based on phusion/baseimage-docker container for minimal Ubuntu image:

# docker create --name tomcat startext/oracle-jdk-8

Install Tomcat 8 in container:

# docker exec -ti tomcat
# apt-get update && apt-get install tomcat8 tomcat8-admin

Create startup script:

# mkdir /etc/service/tomcat8
# echo '#!/bin/sh' > /etc/service/tomcat8/run
# echo 'exec $CATALINA_HOME/bin/catalina.sh run' >> /etc/service/tomcat8/run
# chown root /etc/service/tomcat8/run
# chmod a+x /etc/service/tomcat8/run
Content type