Skip to content

Commit 5162503

Browse files
committed
shibboleth-sp based on centos, to replace debian build
1 parent 147e51d commit 5162503

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

shibboleth-sp/Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM centos:centos7
2+
3+
# Based on: https://github.com/jtgasper3/docker-images/blob/master/centos-shib-sp/Dockerfile
4+
5+
ENV APACHE_VERSION 2.4.6-67.el7.centos.6
6+
ENV SHIBBOLETH_VERSION 2.6.1-3.1
7+
RUN yum -y update \
8+
&& yum -y install wget \
9+
&& wget http://download.opensuse.org/repositories/security://shibboleth/CentOS_7/security:shibboleth.repo -P /etc/yum.repos.d \
10+
&& sed -i -e "s/download\./\downloadcontent\./" /etc/yum.repos.d/security\:shibboleth.repo \
11+
&& yum -y install httpd-${APACHE_VERSION} mod_ssl shibboleth-${SHIBBOLETH_VERSION} \
12+
&& yum -y clean all
13+
14+
RUN echo "export LD_LIBRARY_PATH=/opt/shibboleth/lib64:$LD_LIBRARY_PATH" >> /etc/sysconfig/shibd \
15+
&& echo "export SHIBD_USER=shibd" >> /etc/sysconfig/shibd \
16+
&& sed -i \
17+
-e "s|log4j.appender.shibd_log=.*$|log4j.appender.shibd_log=org.apache.log4j.ConsoleAppender|" \
18+
-e "s|log4j.appender.warn_log=.*$|log4j.appender.warn_log=org.apache.log4j.ConsoleAppender|" \
19+
-e "s|log4j.appender.tran_log=.*$|log4j.appender.tran_log=org.apache.log4j.ConsoleAppender|" \
20+
-e "s|log4j.appender.sig_log=.*$|log4j.appender.sig_log=org.apache.log4j.ConsoleAppender|" \
21+
/etc/shibboleth/shibd.logger
22+
23+
RUN sed -i -r \
24+
-e "s|^(\s*ErrorLog)\s+\S+|\1 /dev/stderr|" \
25+
-e 's|^(\s*CustomLog)\s+\S+\s+(.*$)|\1 /dev/stdout \2 env=\!dontlog|' \
26+
/etc/httpd/conf/httpd.conf \
27+
&& echo "ServerSignature Off" >> /etc/httpd/conf/httpd.conf \
28+
&& echo "ServerTokens Prod" >> /etc/httpd/conf/httpd.conf \
29+
&& rm -f /etc/httpd/conf.d/{autoindex.conf,welcome.conf}
30+
31+
COPY httpd-shibd-foreground /usr/local/bin/
32+
RUN chmod +x /usr/local/bin/httpd-shibd-foreground
33+
34+
EXPOSE 80 443
35+
36+
CMD ["httpd-shibd-foreground"]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Based on: /etc/shibboleth/shibd-redhat
5+
6+
shibd="/usr/sbin/shibd"
7+
SHIBD_USER=root
8+
SHIBD_WAIT=30
9+
prog=shibd
10+
11+
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
12+
13+
# Make sure package run directory exists.
14+
[ -d /var/run/shibboleth ] || mkdir /var/run/shibboleth
15+
16+
# Handle transition from root to non-root packages.
17+
chown -R $SHIBD_USER:$SHIBD_USER /var/run/shibboleth /var/cache/shibboleth 2>/dev/null || :
18+
$shibd -F -f -w $SHIBD_WAIT -u $SHIBD_USER &
19+
20+
# Apache gets grumpy about PID files pre-existing
21+
rm -f /var/run/apache2/apache2.pid
22+
exec apachectl -DFOREGROUND

0 commit comments

Comments
 (0)