diff --git a/README.md b/README.md index b601b0a..25ad6b1 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ A set of Grouper images that are used during I2/TIER training. ## Full Demo ``` -docker run -d -p 80:80 -p 443:443 -p 4443:4443 -p 3306:3306 \ +docker run -d -p 80:80 -p 389:389 -p 443:443 -p 3306:3306 -p 4443:4443 \ --name grouper-demo tier/grouper_training_full_demo:latest ``` @@ -15,8 +15,8 @@ Browse to `https://localhost/grouper` ## Exercises ``` -docker run -d -p 80:80 -p 443:443 -p 4443:4443 -p 3306:3306 \ - --name grouper-demo tier/grouper_training_full_ex###:latest +docker run -d -p 80:80 -p 389:389 -p 443:443 -p 3306:3306 -p 4443:4443 \ + --name grouper tier/grouper_training_ex###:latest ``` Browse to `https://localhost/grouper` diff --git a/base/Dockerfile b/base/Dockerfile index 46e8102..4984daf 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -8,6 +8,9 @@ LABEL author="tier-packaging@internet2.edu " \ ImageName=$imagename \ ImageOS=centos7 +ENV ENV=training \ + USERTOKEN=3.2.0_base + RUN yum install -y epel-release \ && yum install -y mariadb mariadb-server openldap openldap-clients openldap-servers \ && yum clean all @@ -73,15 +76,12 @@ COPY container_files/tier-support/* /opt/tier-support/ COPY container_files/tls/host-key.pem /etc/pki/tls/private/ COPY container_files/tls/* /etc/pki/tls/certs/ COPY container_files/ui/* /opt/grouper/grouper.ui/WEB-INF/ +COPY container_files/usr-local-bin/* /usr/local/bin/ RUN cp /opt/tier-support/grouper.xml /opt/tier-support/grouper-ws.xml /opt/tomcat/conf/Catalina/localhost/ \ - && . /usr/local/bin/library.sh \ - && prepUI \ - && prepWS \ - && prepDaemon \ && chown -R tomcat /opt/shibboleth-idp/ \ && chmod -R 700 /opt/shibboleth-idp/ EXPOSE 389 3306 4443 -CMD LD_LIBRARY_PATH=/opt/shibboleth/lib64:$LD_LIBRARY_PATH && exec /usr/bin/supervisord -c /opt/tier-support/supervisord-training.conf +CMD ["grouper"] \ No newline at end of file diff --git a/base/container_files/tier-support/supervisord-training.conf b/base/container_files/tier-support/supervisord-training.conf index b58402e..e821d48 100644 --- a/base/container_files/tier-support/supervisord-training.conf +++ b/base/container_files/tier-support/supervisord-training.conf @@ -1,5 +1,5 @@ [supervisord] -logfile=/dev/fd/1 ; supervisord log file +logfile=/tmp/logsuperd ; supervisord log file logfile_maxbytes=0 ; maximum size of logfile before rotation loglevel=error ; info, debug, warn, trace nodaemon=true ; run supervisord as a daemon @@ -16,44 +16,53 @@ serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix so [program:httpd] command=httpd -DFOREGROUND -stderr_logfile = /dev/fd/2 +stderr_logfile = /tmp/loghttpd stderr_logfile_maxbytes=0 -stdout_logfile = /dev/fd/1 +stdout_logfile = /tmp/loghttpd stdout_logfile_maxbytes=0 +priority=15 [program:shibbolethsp] user=shibd command=/usr/sbin/shibd -f -F -stderr_logfile = /dev/fd/2 +stderr_logfile = /tmp/logshidb stderr_logfile_maxbytes=0 -stdout_logfile = /dev/fd/1 +stdout_logfile = /tmp/logshidb stdout_logfile_maxbytes=0 +priority=15 [program:tomcat] user=tomcat -command=/opt/tomcat/bin/catalina.sh run -stderr_logfile = /dev/fd/2 +command=bash -c "while ! curl -s localhost:3306 > /dev/null; do echo waiting for mysql to start; sleep 3; done; while ! curl -s ldap://localhost:389 > /dev/null; do echo waiting for ldap to start; sleep 3; done; exec /opt/tomcat/bin/catalina.sh run" +stderr_logfile = /tmp/logtomcat stderr_logfile_maxbytes=0 -stdout_logfile = /dev/fd/1 +stdout_logfile = /tmp/logtomcat stdout_logfile_maxbytes=0 +priority=300 + [program:mysql] command=/usr/bin/mysqld_safe -stderr_logfile = /dev/fd/2 +stderr_logfile = /tmp/lopipe stderr_logfile_maxbytes=0 -stdout_logfile = /dev/fd/1 +stdout_logfile = /tmp/logpipe stdout_logfile_maxbytes=0 +priority=10 [program:openldap] command=/usr/sbin/slapd -h "ldap:/// ldaps:/// ldapi:///" -u ldap -stderr_logfile = /dev/fd/2 +stderr_logfile = /tmp/logpipe stderr_logfile_maxbytes=0 -stdout_logfile = /dev/fd/1 +stdout_logfile = /tmp/logpipe stdout_logfile_maxbytes=0 +priority=10 + [program:grouperDaemon] -command=sh /opt/grouper/grouper.apiBinary/bin/gsh -loader -stderr_logfile = /dev/fd/2 +command=bash -c "while ! curl -s localhost:3306 > /dev/null; do echo waiting for mysql to start; sleep 3; done; while ! curl -s ldap://localhost:389 > /dev/null; do echo waiting for ldap to start; sleep 3; done; exec /opt/grouper/grouper.apiBinary/bin/gsh -loader" +environment=GSH_JVMARGS="-DENV=%(ENV_ENV)s -DUSERTOKEN=%(ENV_USERTOKEN)s" +stderr_logfile = /tmp/loggrouper stderr_logfile_maxbytes=0 -stdout_logfile = /dev/fd/1 +stdout_logfile = /tmp/loggrouper stdout_logfile_maxbytes=0 +priority=300 diff --git a/base/container_files/usr-local-bin/grouper b/base/container_files/usr-local-bin/grouper new file mode 100755 index 0000000..dca1343 --- /dev/null +++ b/base/container_files/usr-local-bin/grouper @@ -0,0 +1,16 @@ +#!/bin/bash + +rm /tmp/logpipe + +. /usr/local/bin/library.sh + +prepDaemon +prepUI +prepWS + +export LD_LIBRARY_PATH=/opt/shibboleth/lib64:$LD_LIBRARY_PATH + +exec /usr/bin/supervisord -c /opt/tier-support/supervisord-training.conf + + + diff --git a/exercise1/Dockerfile b/exercise1/Dockerfile index f0cb9fa..a6fa7ad 100644 --- a/exercise1/Dockerfile +++ b/exercise1/Dockerfile @@ -5,3 +5,5 @@ LABEL author="tier-packaging@internet2.edu " \ ImageType="Grouper Training" \ ImageName=$imagename \ ImageOS=centos7 + +ENV USERTOKEN=3.2.0_ex1 diff --git a/exercise2/Dockerfile b/exercise2/Dockerfile index 8314b95..790d326 100644 --- a/exercise2/Dockerfile +++ b/exercise2/Dockerfile @@ -6,9 +6,6 @@ LABEL author="tier-packaging@internet2.edu " \ ImageName=$imagename \ ImageOS=centos7 -COPY container_files/subject.properties /opt/grouper/conf +ENV USERTOKEN=3.2.0_ex2 -RUN . /usr/local/bin/library.sh \ - && prepDaemon \ - && prepUI \ - && prepWS +COPY container_files/subject.properties /opt/grouper/conf diff --git a/full-demo/Dockerfile b/full-demo/Dockerfile index 23dd30f..aa8d158 100644 --- a/full-demo/Dockerfile +++ b/full-demo/Dockerfile @@ -6,6 +6,8 @@ LABEL author="tier-packaging@internet2.edu " \ ImageName=$imagename \ ImageOS=centos7 +ENV USERTOKEN=3.2.0_full_demo + COPY container_files/demo.gsh /seed-data/ COPY container_files/grouper-loader.properties /opt/grouper/conf/ @@ -19,8 +21,3 @@ RUN (/usr/sbin/slapd -h "ldap:/// ldaps:/// ldapi:///" -u ldap &) \ && while curl -s ldap://localhost:389 > /dev/null; do echo waiting for ldap to stop; sleep 1; done; \ pkill -u mysql mysqld \ && while curl -s localhost:3306 > /dev/null; do echo waiting for mysqld to stop; sleep 1; done - -RUN . /usr/local/bin/library.sh \ - && prepDaemon \ - && prepUI \ - && prepWS