diff --git a/Dockerfile b/Dockerfile index c5767f7..12b856f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,8 @@ ARG maintainer=tier ARG imagename=shibboleth_idp ARG version=3.3.0 ENV VERSION=$version +ENV IMAGENAME=$imagename +ENV MAINTAINER=$maintainer MAINTAINER $maintainer LABEL Vendor="Internet2" @@ -72,7 +74,7 @@ RUN mkdir -p "$CATALINA_HOME" # done ENV TOMCAT_MAJOR 8 -ENV TOMCAT_VERSION 8.0.39 +ENV TOMCAT_VERSION 8.0.41 ENV TOMCAT_TGZ_URL https://www.apache.org/dist/tomcat/tomcat-$TOMCAT_MAJOR/v$TOMCAT_VERSION/bin/apache-tomcat-$TOMCAT_VERSION.tar.gz WORKDIR $CATALINA_HOME @@ -90,6 +92,15 @@ RUN set -x \ ADD files/idp.xml conf/Catalina/idp.xml ADD files/server.xml conf/server.xml +ADD files/tier-crontab /opt/tier/tier-crontab +RUN crontab /opt/tier/tier-crontab +ADD files/bin/startcron.sh /usr/bin/startcron.sh +RUN chmod +x /usr/bin/startcron.sh +ADD files/bin/sendtierbeacon.sh /usr/bin/sendtierbeacon.sh +RUN touch /var/log/cron.log + ENV PATH $CATALINA_HOME/bin:$JAVA_HOME/bin:$PATH ONBUILD COPY ./root/ /opt/shibboleth/$SHIB_PREFIX/ + +CMD /usr/bin/startcron.sh diff --git a/files/bin/sendtierbeacon.sh b/files/bin/sendtierbeacon.sh new file mode 100644 index 0000000..583ea30 --- /dev/null +++ b/files/bin/sendtierbeacon.sh @@ -0,0 +1,7 @@ +#!/bin/sh +LOGHOST="cerif.org" +LOGPORT="5000" +LOGTEXT="TIERBEACON/TIER/1.0#IM=$IMAGENAME#IV=$VERSION#MT=$MAINTAINER#" +if [ -z "$TIER_BEACON_OPT_OUT" ]; then + `logger -n $LOGHOST -P $LOGPORT -t TIERBEACON $LOGTEXT` +fi \ No newline at end of file diff --git a/files/bin/startcron.sh b/files/bin/startcron.sh new file mode 100644 index 0000000..571fe0e --- /dev/null +++ b/files/bin/startcron.sh @@ -0,0 +1,3 @@ +#!/bin/sh +cron +touch /var/log/cron.log diff --git a/files/tier-crontab b/files/tier-crontab new file mode 100644 index 0000000..590dd74 --- /dev/null +++ b/files/tier-crontab @@ -0,0 +1,2 @@ +#send daily ping to TIER Central +0 0 * * * /usr/bin/sendtierbeacon.sh >> /var/log/cron.log 2>&1