From 6f1f28dbb5dc494bafe36176c91b4fcec10e3eb1 Mon Sep 17 00:00:00 2001 From: Jim Van Fleet Date: Wed, 24 Aug 2016 16:46:36 -0400 Subject: [PATCH] Tests passing, next expansion to runtime --- Dockerfile | 28 ++++++++++++++++++++++++++++ common.bash | 4 ++-- httpd-shib-foreground | 7 +++++++ tests/image.bats | 11 +++++++++++ 4 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 Dockerfile create mode 100755 httpd-shib-foreground create mode 100644 tests/image.bats diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f9b7934 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +FROM bigfleet/centos7base + +# Define args and set a default value +ARG maintainer=tier +ARG imagename=shibboleth_sp +ARG version=1.0 + +MAINTAINER $maintainer +LABEL Vendor="Internet2" +LABEL ImageType="Base" +LABEL ImageName=$imagename +LABEL ImageOS=centos7 +LABEL Version=$version + +LABEL Build docker build --rm --tag $maintainer/$imagename . + +RUN curl -o /etc/yum.repos.d/security:shibboleth.repo \ + http://download.opensuse.org/repositories/security://shibboleth/CentOS_7/security:shibboleth.repo \ + && yum -y update && yum -y install shibboleth.x86_64 httpd mod_ssl && yum clean all \ + && rm /etc/httpd/conf.d/autoindex.conf \ + && rm /etc/httpd/conf.d/ssl.conf \ + && rm /etc/httpd/conf.d/userdir.conf \ + && rm /etc/httpd/conf.d/welcome.conf + +COPY httpd-shib-foreground /usr/local/bin/ + +EXPOSE 80 443 +CMD ["httpd-shib-foreground"] \ No newline at end of file diff --git a/common.bash b/common.bash index 96e0143..7ffb16a 100644 --- a/common.bash +++ b/common.bash @@ -1,2 +1,2 @@ -maintainer="tier" -imagename="imagename-replaceme-in-common-bash" \ No newline at end of file +maintainer="bigfleet" +imagename="shibboleth_sp" \ No newline at end of file diff --git a/httpd-shib-foreground b/httpd-shib-foreground new file mode 100755 index 0000000..60a415f --- /dev/null +++ b/httpd-shib-foreground @@ -0,0 +1,7 @@ +#!/bin/sh +set -e + +# Apache gets grumpy about PID files pre-existing +rm -f /etc/httpd/logs/httpd.pid + +(/usr/sbin/shibd) & httpd -DFOREGROUND diff --git a/tests/image.bats b/tests/image.bats new file mode 100644 index 0000000..485b153 --- /dev/null +++ b/tests/image.bats @@ -0,0 +1,11 @@ +#!/usr/bin/env bats + +load ../common + +@test "Shibd binary available" { + docker run -i $maintainer/$imagename find /usr/sbin/shibd +} + +@test "Shibboleth root available" { + docker run -i $maintainer/$imagename find /etc/shibboleth +} \ No newline at end of file