diff --git a/Dockerfile b/Dockerfile index c0b2345..0b1f6f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,23 @@ -FROM tier/shibboleth_sp - -# Define args and set a default value -ARG maintainer=tier -ARG imagename=siteadmin-sp -ARG version=1.0 - -MAINTAINER $maintainer -LABEL Vendor="Internet2" -LABEL ImageType="SP" -LABEL ImageName=$imagename -LABEL ImageOS=centos7 -LABEL Version=$version - -LABEL Build docker build --rm --tag $maintainer/$imagename . +FROM bigfleet/siteadmin:latest +# Installs Apache Passenger prereqs +RUN apt-get install -y dirmngr gnupg && \ + apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7 && \ + apt-get install -y apt-transport-https ca-certificates && \ + sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger jessie main > /etc/apt/sources.list.d/passenger.list' && \ + apt-get update && \ + apt-get install -y \ + apache2-threaded-dev \ + apache2-mpm-worker \ + libapache2-mod-passenger \ + odbc-postgresql \ + passenger \ + shibboleth-sp2-utils + ADD ./container_files /opt -RUN rm /etc/httpd/conf.d/ssl.conf && \ - cp /opt/etc/httpd/conf.d/*.conf /etc/httpd/conf.d/. && \ - cp /opt/etc/shibboleth/* /etc/shibboleth/. +RUN cp /opt/etc/httpd/conf.d/*.conf /etc/apache2/conf-available/. && \ + cp /opt/etc/shibboleth/* /etc/shibboleth/. && \ + a2enconf log && a2enconf shib + +EXPOSE 80 443 \ No newline at end of file diff --git a/tests/image.bats b/tests/image.bats index a936107..057f8f0 100644 --- a/tests/image.bats +++ b/tests/image.bats @@ -4,19 +4,19 @@ load ../common @test "Shibboleth configuration for httpd secures siteadmin" { - docker run -i $maintainer/$imagename grep siteadmin /etc/httpd/conf.d/shib.conf + docker run -i $maintainer/$imagename grep siteadmin /etc/apache2/conf-enabled/shib.conf } @test "Log configuration in place" { - docker run -i $maintainer/$imagename find /etc/httpd/conf.d/log.conf + docker run -i $maintainer/$imagename find /etc/apache2/conf-enabled/log.conf } -@test "shibboleth2.xml not using a TCP Listener configuration" { - docker run -i $maintainer/$imagename grep -v TCPListener /etc/shibboleth/shibboleth2.xml +@test "Passenger installation validates" { + docker run -i $maintainer/$imagename /usr/bin/passenger-config validate-install --auto } -@test "Shibboleth configuration is well formed" { - docker run -i $maintainer/$imagename xmlwf /etc/shibboleth/shibboleth2.xml +@test "shibboleth2.xml not using a TCP Listener configuration" { + docker run -i $maintainer/$imagename grep -v TCPListener /etc/shibboleth/shibboleth2.xml } @test "Shibboleth configuration is valid" {