From 78ec02e2aaebb940b81638f141c4b9402afddf4d Mon Sep 17 00:00:00 2001 From: Paul Caskey Date: Sat, 17 Nov 2018 22:58:06 +0000 Subject: [PATCH] initial commit --- Dockerfile | 31 ++++++ container_files/attribute-map.xml | 162 ++++++++++++++++++++++++++++++ container_files/start.bat | 4 + 3 files changed, 197 insertions(+) create mode 100644 Dockerfile create mode 100644 container_files/attribute-map.xml create mode 100644 container_files/start.bat diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bf18cd7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +FROM microsoft/iis + +ENV SP_VERSION=3.0.2.0 +RUN powershell [Environment]::SetEnvironmentVariable('SP_VERSION','%SP_VERSION%', [System.EnvironmentVariableTarget]::Machine ) + +#install shibb sp +RUN powershell (new-object System.Net.WebClient).Downloadfile('https://shibboleth.net/downloads/service-provider/latest/win64/shibboleth-sp-%SP_VERSION%-win64.msi', 'C:\shibboleth-sp-%SP_VERSION%-win64.msi') +RUN powershell If ((Get-FileHash C:\shibboleth-sp-%SP_VERSION%-win64.msi -Algorithm SHA1).Hash.ToLower() -eq '4b9dcafb46ddc00849ccea96961d3fbb95bbd544') { ` \ + start-process -filepath c:\windows\system32\msiexec.exe -passthru -wait -argumentlist '/i','C:\shibboleth-sp-%SP_VERSION%-win64.msi','/qn' ` \ + } Else { throw 'bad hash comparison on SP download' } +RUN del C:\shibboleth-sp-%SP_VERSION%-win64.msi +RUN C:\Windows\System32\inetsrv\appcmd install module /name:ShibNative32 /image:"c:\opt\shibboleth-sp\lib\shibboleth\iis7_shib.dll" /precondition:bitness32 +RUN C:\Windows\System32\inetsrv\appcmd install module /name:ShibNative /image:"c:\opt\shibboleth-sp\lib64\shibboleth\iis7_shib.dll" /precondition:bitness64 +COPY container_files/attribute-map.xml c:/opt/shibboleth-sp/etc/shibboleth/ + +#add ASP.NET and IIS svc monitor +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] +RUN Add-WindowsFeature Web-Server; ` \ + Add-WindowsFeature NET-Framework-45-ASPNET; ` \ + Add-WindowsFeature Web-Asp-Net45; ` \ + Remove-Item -Recurse C:\inetpub\wwwroot\*; ` \ + Invoke-WebRequest -Uri https://dotnetbinaries.blob.core.windows.net/servicemonitor/2.0.1.6/ServiceMonitor.exe -OutFile C:\ServiceMonitor.exe + +#healthcheck command for container state reporting +HEALTHCHECK --interval=1m --timeout=30s \ + CMD powershell [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}; (new-object System.Net.WebClient).DownloadString("http://127.0.0.1/Shibboleth.sso/Status") + +#start both shibd and IIS +COPY container_files/start.bat c:/ +ENTRYPOINT ["C:\\start.bat"] + diff --git a/container_files/attribute-map.xml b/container_files/attribute-map.xml new file mode 100644 index 0000000..65475a9 --- /dev/null +++ b/container_files/attribute-map.xml @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/container_files/start.bat b/container_files/start.bat new file mode 100644 index 0000000..f8ddd8d --- /dev/null +++ b/container_files/start.bat @@ -0,0 +1,4 @@ + +C:\Windows\System32\sc start shibd_Default +C:\ServiceMonitor.exe w3svc +