diff --git a/glassfish/3.1.2.2/Dockerfile b/glassfish/3.1.2.2/Dockerfile new file mode 100644 index 0000000..ddbbacb --- /dev/null +++ b/glassfish/3.1.2.2/Dockerfile @@ -0,0 +1,31 @@ +FROM dockerfile/java + +MAINTAINER martin.maher@consol.de + +EXPOSE 8080 +EXPOSE 8081 +EXPOSE 4848 +EXPOSE 8686 + +ENV GLASSFISH_VERSION 3.1.2.2 +ENV DEPLOY_DIR /maven + +RUN wget http://dlc.sun.com.edgesuite.net/glassfish/${GLASSFISH_VERSION}/release/glassfish-${GLASSFISH_VERSION}.zip -O /tmp/glassfish.zip + +# Unpack +RUN unzip /tmp/glassfish.zip -d /opt +RUN ln -s /opt/glassfish3 /opt/glassfish +RUN rm /tmp/glassfish.zip + +# Startup script +ADD deploy-and-run.sh /opt/glassfish/bin/ + +# Copy over custom domain.xml +# todo set custom java.security.egd property + +# VOLUME ["/opt/tomcat/logs", "/opt/tomcat/work", "/opt/tomcat/temp", "/tmp/hsperfdata_root" + +ENV GLASSFISH_HOME /opt/glassfish +ENV PATH $PATH:$GLASSFISH_HOME/bin + +CMD /opt/glassfish/bin/deploy-and-run.sh diff --git a/glassfish/3.1.2.2/deploy-and-run.sh b/glassfish/3.1.2.2/deploy-and-run.sh new file mode 100755 index 0000000..767497e --- /dev/null +++ b/glassfish/3.1.2.2/deploy-and-run.sh @@ -0,0 +1,11 @@ +#!/bin/sh +DIR=${DEPLOY_DIR:-/maven} +echo "Checking *.war in $DIR" +if [ -d $DIR ]; then + for i in $DIR/*.war; do + file=$(basename $i) + echo "Linking $i --> /opt/glassfish/glassfish/domains/domain1/autodeploy/$file" + ln -s $i /opt/glassfish/glassfish/domains/domain1/autodeploy/$file + done +fi +/opt/glassfish/bin/asadmin start-domain --verbose