Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: docker/grouper
base: appliance
Choose a base ref
...
head repository: docker/grouper
compare: main
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Apr 4, 2018

  1. Copy the full SHA
    1893330 View commit details
  2. Merge pull request #34 from docker/2.3.0-a99-u44-w11-p16

    Merging grouper_noVM into grouper master
    chubing committed Apr 4, 2018
    Copy the full SHA
    ba1cafb View commit details
  3. Cleanup

    chubing committed Apr 4, 2018
    Copy the full SHA
    631ce07 View commit details
  4. Copy the full SHA
    3d50833 View commit details
  5. Update common.bash

    chubing committed Apr 4, 2018
    Copy the full SHA
    90c8bc6 View commit details
  6. Merge pull request #36 from docker/2.3.0-a99-u44-w11-p16

    Update common.bash to reflect master
    chubing committed Apr 4, 2018
    Copy the full SHA
    22b216e View commit details
  7. Updating links to the new repo

    jgasper committed Apr 4, 2018
    Copy the full SHA
    308b293 View commit details

Commits on Apr 12, 2018

  1. bumping grouper api patch to 103

    John Gasper committed Apr 12, 2018
    Copy the full SHA
    6661eb4 View commit details

Commits on Apr 18, 2018

  1. making the lib and conf copies recursive

    John Gasper committed Apr 18, 2018
    Copy the full SHA
    70dd9f3 View commit details
  2. Copy the full SHA
    25417ca View commit details
  3. Merge pull request #37 from docker/jenkins-todocker-no-cache

    add --no-cache to docker build arguments
    chubing committed Apr 18, 2018
    Copy the full SHA
    cb32f9d View commit details

Commits on Apr 24, 2018

  1. removing the default encryption cert/key; adding information about ge…

    …nerating SP key/cert as well as an other option for setting up the database.
    John Gasper committed Apr 24, 2018
    Copy the full SHA
    dc872c7 View commit details
  2. Copy the full SHA
    a6ac9dd View commit details
  3. fixing GH MD formatting

    John Gasper committed Apr 24, 2018
    Copy the full SHA
    19bc47d View commit details

Commits on Apr 26, 2018

  1. fixing issue with where Daemon libraries are copied too

    John Gasper committed Apr 26, 2018
    Copy the full SHA
    1ea72e2 View commit details

Commits on Apr 30, 2018

  1. Update README.md

    John Gasper committed Apr 30, 2018
    Copy the full SHA
    998429f View commit details

Commits on May 2, 2018

  1. updating patch level

    chubing committed May 2, 2018
    Copy the full SHA
    501167c View commit details
  2. Update Jenkinsfile

    chubing committed May 2, 2018
    Copy the full SHA
    64e3953 View commit details
  3. Update Jenkinsfile

    chubing committed May 2, 2018
    Copy the full SHA
    d9391b1 View commit details
  4. Update Jenkinsfile

    chubing committed May 2, 2018
    Copy the full SHA
    e8eba92 View commit details
  5. Update Jenkinsfile

    chubing committed May 2, 2018
    Copy the full SHA
    bfbfdd4 View commit details
  6. Update Jenkinsfile

    chubing committed May 2, 2018
    Copy the full SHA
    c369a62 View commit details
  7. Merge pull request #39 from docker/2.3.0-a103-u42-w12-p16

    2.3.0 a103 u42 w12 p16
    chubing committed May 2, 2018
    Copy the full SHA
    e2f959c View commit details
  8. Configuring Grouper to logout via the Shib SP

    John Gasper committed May 2, 2018
    Copy the full SHA
    bf7972d View commit details

Commits on May 8, 2018

  1. Update gsh

    John Gasper committed May 8, 2018
    Copy the full SHA
    b4f86a5 View commit details
  2. Update daemon

    John Gasper committed May 8, 2018
    Copy the full SHA
    269044d View commit details
  3. Copy the full SHA
    897c9db View commit details
  4. Update docker-compose.yml

    chubing committed May 8, 2018
    Copy the full SHA
    d32b03e View commit details
  5. Merge pull request #40 from docker/persistent-data-volume

    Persistent data volumes for ldap and mysql
    chubing committed May 8, 2018
    Copy the full SHA
    eff9c3d View commit details

Commits on May 12, 2018

  1. minor tweaks

    John Gasper committed May 12, 2018
    Copy the full SHA
    27040f3 View commit details

Commits on May 16, 2018

  1. wait for ldap to start

    John Gasper committed May 16, 2018
    Copy the full SHA
    1df10e8 View commit details
  2. Update docker-compose.yml

    John Gasper committed May 16, 2018
    Copy the full SHA
    789ac59 View commit details
  3. Update Dockerfile

    John Gasper committed May 16, 2018
    Copy the full SHA
    a5a9343 View commit details
  4. 2.3.0-a106-u43-w12-p16

    grouper_v2_3_0_api_patch_106
    grouper_v2_3_0_ui_patch_43
    grouper_v2_3_0_ws_patch_12
    grouper_v2_3_0_pspng_patch_16
    chubing committed May 16, 2018
    Copy the full SHA
    aa40fc2 View commit details

Commits on May 17, 2018

  1. Update daemon

    chubing committed May 17, 2018
    Copy the full SHA
    ec764d0 View commit details
  2. Merge pull request #41 from docker/fix-daemon-script

    Update daemon
    chubing committed May 17, 2018
    Copy the full SHA
    0505eb6 View commit details
  3. Merge pull request #42 from docker/2.3.0-a106-u43-w12-p16

    2.3.0-a106-u43-w12-p16
    chubing committed May 17, 2018
    Copy the full SHA
    9ac51b3 View commit details
  4. try test-compose after build

    chubing committed May 17, 2018
    Copy the full SHA
    2abfbfb View commit details
  5. Update Jenkinsfile

    chubing committed May 17, 2018
    Copy the full SHA
    b256a93 View commit details
  6. Update Jenkinsfile

    chubing committed May 17, 2018
    Copy the full SHA
    5bf134b View commit details
  7. Update Jenkinsfile

    chubing committed May 17, 2018
    Copy the full SHA
    bac85a4 View commit details
  8. Copy the full SHA
    00b49d9 View commit details
  9. reverting intentional failure

    chubing committed May 17, 2018
    Copy the full SHA
    13c7a1b View commit details

Commits on May 18, 2018

  1. Merge pull request #43 from docker/test-compose

    added steps to test composing environment before pushing to dockerhub
    chubing committed May 18, 2018
    Copy the full SHA
    9dcad39 View commit details
  2. Copy the full SHA
    2f80c0f View commit details
  3. Merge pull request #44 from docker/fix-ds-setup.inf

    change example.edu to internet2.edu
    chubing committed May 18, 2018
    Copy the full SHA
    0b4ceb8 View commit details

Commits on May 21, 2018

  1. re-working entrypoint/start-up scripts; fixed a few other things alon…

    …g the way.
    John Gasper committed May 21, 2018
    Copy the full SHA
    bbbda9d View commit details
  2. Merge branch 'master' of github.internet2.edu:docker/grouper into tes…

    …t-changes
    John Gasper committed May 21, 2018
    Copy the full SHA
    825494a View commit details

Commits on May 24, 2018

  1. Update README.md

    chubing committed May 24, 2018
    Copy the full SHA
    6da580c View commit details
  2. Update README.md

    chubing committed May 24, 2018
    Copy the full SHA
    b680ca8 View commit details
Showing with 23,637 additions and 819 deletions.
  1. +0 −41 BINSCRIPTS.md
  2. +147 −66 Dockerfile
  3. +118 −75 Jenkinsfile
  4. +201 −0 LICENSE
  5. +372 −3 README.md
  6. +0 −6 bin/ci-run.sh
  7. +0 −8 bin/ci-stop.sh
  8. +0 −1 common.bash
  9. +144 −0 container_files/api/log4j.properties
  10. +0 −22 container_files/autoexec/onbuild/0_install_java.sh
  11. +0 −15 container_files/bin/check.sh
  12. +0 −11 container_files/bin/cleanup.sh
  13. +0 −33 container_files/bin/configure.sh
  14. +0 −23 container_files/bin/main.sh
  15. +0 −4 container_files/bin/run.sh
  16. +0 −69 container_files/bin/start.sh
  17. +0 −8 container_files/bin/tier-bootstrap.gsh
  18. +0 −7 container_files/etc/MariaDB.repo
  19. +0 −8 container_files/etc/grouper.hibernate.pointer.properties
  20. +0 −43 container_files/etc/grouper.installer.properties
  21. +0 −2 container_files/etc/grouper.properties
  22. +46 −0 container_files/grouper.installer.properties
  23. +20 −0 container_files/httpd/grouper-www.conf
  24. +28 −0 container_files/httpd/ssl-enabled.conf
  25. +1 −0 container_files/morphString.properties
  26. +153 −0 container_files/shibboleth/attribute-map.xml
  27. +39 −0 container_files/shibboleth/native.logger
  28. +59 −0 container_files/shibboleth/shibd.logger
  29. +6 −0 container_files/tier-support/grouper-ws-scim.xml
  30. +4 −0 container_files/tier-support/grouper-ws.xml
  31. +4 −0 container_files/tier-support/grouper.xml
  32. +39 −0 container_files/tier-support/supervisord-tomcat.conf
  33. +31 −0 container_files/tier-support/supervisord-tomee.conf
  34. +3 −0 container_files/tomcat/bin/setenv.sh
  35. +26 −0 container_files/tomcat/conf/log4j2.xml
  36. +173 −0 container_files/tomcat/conf/server.xml
  37. +46 −0 container_files/tomcat/conf/tomcat-users.xml
  38. +3 −0 container_files/tomee/bin/setenv.sh
  39. +26 −0 container_files/tomee/conf/log4j2.xml
  40. +164 −0 container_files/tomee/conf/server.xml
  41. +51 −0 container_files/tomee/conf/tomcat-users.xml
  42. +12 −0 container_files/ui/classes/grouper-ui.properties
  43. +144 −0 container_files/ui/classes/log4j.properties
  44. +89 −0 container_files/ui/web.xml
  45. +9 −0 container_files/usr-local-bin/daemon
  46. +6 −0 container_files/usr-local-bin/entrypoint.sh
  47. +9 −0 container_files/usr-local-bin/gsh
  48. +149 −0 container_files/usr-local-bin/library.sh
  49. +7 −0 container_files/usr-local-bin/scim
  50. +9 −0 container_files/usr-local-bin/ui
  51. +10 −0 container_files/usr-local-bin/ui-ws
  52. +7 −0 container_files/usr-local-bin/ws
  53. +0 −20 container_files/wait-for-it/LICENSE
  54. +0 −59 container_files/wait-for-it/README.md
  55. +0 −161 container_files/wait-for-it/wait-for-it.sh
  56. +144 −0 container_files/ws/classes/log4j.properties
  57. +0 −25 files/bin/sendtierbeacon.sh
  58. +0 −5 files/bin/setenv.sh
  59. +0 −22 files/bin/startup.sh
  60. +5 −0 manualBuild.sh
  61. +64 −0 test-compose/README.md
  62. +2 −0 test-compose/compose.sh
  63. 0 test-compose/configs-and-secrets/grouper/database_password.txt
  64. +63 −0 test-compose/configs-and-secrets/grouper/grouper-loader.properties
  65. +112 −0 test-compose/configs-and-secrets/grouper/grouper.client.properties
  66. +3 −23 {container_files/etc → test-compose/configs-and-secrets/grouper}/grouper.hibernate.properties
  67. +25 −0 test-compose/configs-and-secrets/grouper/grouper.properties
  68. +1 −0 test-compose/configs-and-secrets/grouper/rabbitmq_password.txt
  69. +81 −0 test-compose/configs-and-secrets/grouper/subject.properties
  70. 0 test-compose/configs-and-secrets/httpd/cachain-cer.pem
  71. +20 −0 test-compose/configs-and-secrets/httpd/host-cert.pem
  72. +28 −0 test-compose/configs-and-secrets/httpd/host-key.pem
  73. +219 −0 test-compose/configs-and-secrets/shibboleth/idp-metadata.xml
  74. +136 −0 test-compose/configs-and-secrets/shibboleth/shibboleth2.xml
  75. +20 −0 test-compose/configs-and-secrets/shibboleth/sp-cert.pem
  76. +28 −0 test-compose/configs-and-secrets/shibboleth/sp-key.pem
  77. +5 −0 test-compose/daemon/Dockerfile
  78. +52 −0 test-compose/data/Dockerfile
  79. +64 −0 test-compose/data/container_files/conf/grouper-loader.properties
  80. +29 −0 test-compose/data/container_files/conf/grouper.hibernate.properties
  81. +25 −0 test-compose/data/container_files/conf/grouper.properties
  82. +81 −0 test-compose/data/container_files/conf/subject.properties
  83. +10 −0 test-compose/data/container_files/seed-data/bootstrap.gsh
  84. +28 −0 test-compose/data/container_files/seed-data/ds-setup.inf
  85. +2,540 −0 test-compose/data/container_files/seed-data/sisData.sql
  86. +15,522 −0 test-compose/data/container_files/seed-data/users.ldif
  87. +276 −0 test-compose/docker-compose.yml
  88. +5 −0 test-compose/gsh/Dockerfile
  89. +5 −0 test-compose/idp/Dockerfile
  90. +37 −0 test-compose/idp/shibboleth-idp/conf/attribute-filter.xml
  91. +293 −0 test-compose/idp/shibboleth-idp/conf/attribute-resolver.xml
  92. +195 −0 test-compose/idp/shibboleth-idp/conf/idp.properties
  93. +58 −0 test-compose/idp/shibboleth-idp/conf/ldap.properties
  94. +80 −0 test-compose/idp/shibboleth-idp/conf/metadata-providers.xml
  95. +19 −0 test-compose/idp/shibboleth-idp/credentials/idp-backchannel.crt
  96. BIN test-compose/idp/shibboleth-idp/credentials/idp-backchannel.p12
  97. BIN test-compose/idp/shibboleth-idp/credentials/idp-browser.p12
  98. +19 −0 test-compose/idp/shibboleth-idp/credentials/idp-encryption.crt
  99. +27 −0 test-compose/idp/shibboleth-idp/credentials/idp-encryption.key
  100. +19 −0 test-compose/idp/shibboleth-idp/credentials/idp-signing.crt
  101. +27 −0 test-compose/idp/shibboleth-idp/credentials/idp-signing.key
  102. BIN test-compose/idp/shibboleth-idp/credentials/sealer.jks
  103. +2 −0 test-compose/idp/shibboleth-idp/credentials/sealer.kver
  104. +78 −0 test-compose/idp/shibboleth-idp/metadata/grouper-sp.xml
  105. +219 −0 test-compose/idp/shibboleth-idp/metadata/idp-metadata.xml
  106. +8 −0 test-compose/scim/Dockerfile
  107. +51 −0 test-compose/scim/container_files/tomcat-users.xml
  108. +30 −0 test-compose/scim/container_files/web.xml
  109. +7 −0 test-compose/ui/Dockerfile
  110. +69 −0 test-compose/ui/container_files/shibboleth/shibd.logger
  111. +9 −0 test-compose/ws/Dockerfile
  112. +180 −0 test-compose/ws/container_files/server.xml
  113. +46 −0 test-compose/ws/container_files/tomcat-users.xml
  114. +128 −0 test-compose/ws/container_files/web.xml
  115. +72 −0 tests/clairscan.sh
  116. +0 −59 tests/image.bats
  117. +16 −0 tests/main.bats
41 changes: 0 additions & 41 deletions BINSCRIPTS.md

This file was deleted.

213 changes: 147 additions & 66 deletions Dockerfile
@@ -1,73 +1,154 @@
FROM tier/shibboleth_sp

# Define args and set a default value
ARG maintainer=tier
ARG imagename=grouper
ARG version=2.3.0
ARG tierversion=17070

MAINTAINER $maintainer
LABEL Vendor="Internet2"
LABEL ImageType="Base"
LABEL ImageName=$imagename
LABEL ImageOS=centos7
LABEL Version=$version

ENV VERSION=$version
ENV TIERVERSION=$tierversion
ENV IMAGENAME=$imagename
ENV MAINTAINER=$maintainer

ENV TOMCAT_VERSION="8.5.12"
ENV WAIT_TIME=60

LABEL Build docker build --rm --tag $maintainer/$imagename .

ADD container_files /opt
ONBUILD ADD additional_container_files /opt

RUN mkdir -p /opt/grouper/$VERSION \
&& mv /opt/etc/grouper.installer.properties /opt/grouper/$VERSION/. \
&& mv /opt/etc/MariaDB.repo /etc/yum.repos.d/MariaDB.repo \
&& curl -o /opt/grouper/$VERSION/grouperInstaller.jar https://software.internet2.edu/grouper/release/$VERSION/grouperInstaller.jar \
&& yum -y update \
&& yum -y install --setopt=tsflags=nodocs \
dos2unix \
MariaDB-client \
telnet \
emacs \
mlocate \
&& yum clean all \
&& /opt/autoexec/bin/onbuild.sh \
&& rm /opt/grouper/$version/grouper.apiBinary-$version/conf/grouper.hibernate.properties && \
cp /opt/etc/grouper.hibernate.pointer.properties /opt/grouper/$version/grouper.apiBinary-$version/conf/grouper.hibernate.properties && \
rm /opt/grouper/$version/grouper.ws-$version/grouper-ws/build/dist/grouper-ws/WEB-INF/classes/grouper.hibernate.properties && \
cp /opt/etc/grouper.hibernate.pointer.properties /opt/grouper/$version/grouper.ws-$version/grouper-ws/build/dist/grouper-ws/WEB-INF/classes/grouper.hibernate.properties && \
rm /opt/grouper/$version/grouper.ui-$version/dist/grouper/WEB-INF/classes/grouper.hibernate.properties && \
cp /opt/etc/grouper.hibernate.pointer.properties /opt/grouper/$version/grouper.ui-$version/dist/grouper/WEB-INF/classes/grouper.hibernate.properties && \
ln -sf /opt/bin/run.sh /usr/local/bin/run.sh && \
updatedb

#/opt/grouper/2.3.0/grouper.apiBinary-2.3.0/conf/grouper.hibernate.properties
FROM centos:centos7 as installing

RUN yum update -y \
&& yum install -y wget tar unzip dos2unix \
&& yum clean all

# Export this variable so that shibd can find it's CURL library
RUN LD_LIBRARY_PATH="/opt/shibboleth/lib64"
RUN export LD_LIBRARY_PATH

# The installer creates a HSQL DB which we ignore later
ARG GROUPER_CONTAINER_VERSION

ENV GROUPER_VERSION=2.4.0 \
JAVA_HOME=/usr/lib/jvm/zulu-8/ \
GROUPER_CONTAINER_VERSION=$GROUPER_CONTAINER_VERSION

# use Zulu package
RUN rpm --import http://repos.azulsystems.com/RPM-GPG-KEY-azulsystems \
&& curl -o /etc/yum.repos.d/zulu.repo http://repos.azulsystems.com/rhel/zulu.repo \
&& yum -y install zulu-8

#RUN java_version=8.0.172; \
# zulu_version=8.30.0.1; \
# echo 'Downloading the OpenJDK Zulu...' \
# && wget -q http://cdn.azul.com/zulu/bin/zulu$zulu_version-jdk$java_version-linux_x64.tar.gz \
# && echo "0a101a592a177c1c7bc63738d7bc2930 zulu$zulu_version-jdk$java_version-linux_x64.tar.gz" | md5sum -c - \
# && tar -zxvf zulu$zulu_version-jdk$java_version-linux_x64.tar.gz -C /opt \
# && ln -s /opt/zulu$zulu_version-jdk$java_version-linux_x64 $JAVA_HOME

#RUN java_version=8u151; \
# java_bnumber=12; \
# java_semver=1.8.0_151; \
# java_hash=123b1d755416aa7579abc03f01ab946e612e141b6f7564130f2ada00ed913f1d; \
# echo 'Downloading the Oracle Java...' \
# && wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" \
# http://download.oracle.com/otn-pub/java/jdk/$java_version-b$java_bnumber/e758a0de34e24606bca991d704f6dcbf/server-jre-$java_version-linux-x64.tar.gz \
# && echo "$java_hash server-jre-$java_version-linux-x64.tar.gz" | sha256sum -c - \
# && tar -zxvf server-jre-$java_version-linux-x64.tar.gz -C /opt \
# && ln -s /opt/jdk$java_semver/ $JAVA_HOME

RUN echo 'Downloading Grouper Installer...' \
&& mkdir -p /opt/grouper/$GROUPER_VERSION \
&& wget -q -O /opt/grouper/$GROUPER_VERSION/grouperInstaller.jar http://software.internet2.edu/grouper/release/$GROUPER_VERSION/grouperInstaller.jar

COPY container_files/grouper.installer.properties /opt/grouper/$GROUPER_VERSION
# Temporary morphString file used for building, not used in production
COPY container_files/morphString.properties /opt/grouper/$GROUPER_VERSION


RUN echo 'Installing Grouper'; \
PATH=$PATH:$JAVA_HOME/bin; \
cd /opt/grouper/$GROUPER_VERSION/ \
&& $JAVA_HOME/bin/java -cp :grouperInstaller.jar edu.internet2.middleware.grouperInstaller.GrouperInstaller



FROM centos:centos7 as cleanup

ENV GROUPER_VERSION=2.4.0 \
TOMCAT_VERSION=8.5.42 \
TOMEE_VERSION=7.0.0

COPY --from=installing /opt/grouper/$GROUPER_VERSION/grouperInstaller.jar /opt/grouper/
COPY --from=installing /opt/grouper/$GROUPER_VERSION/grouper.apiBinary-$GROUPER_VERSION/ /opt/grouper/grouper.apiBinary/
COPY --from=installing /opt/grouper/$GROUPER_VERSION/grouper.ui-$GROUPER_VERSION/dist/grouper/ /opt/grouper/grouper.ui/
COPY --from=installing /opt/grouper/$GROUPER_VERSION/grouper.ws-$GROUPER_VERSION/grouper-ws/build/dist/grouper-ws/ /opt/grouper/grouper.ws/
COPY --from=installing /opt/grouper/$GROUPER_VERSION/grouper.ws-$GROUPER_VERSION/grouper-ws-scim/targetBuiltin/grouper-ws-scim/ /opt/grouper/grouper.scim/
#COPY --from=installing /opt/grouper/$GROUPER_VERSION/grouper.clientBinary-$GROUPER_VERSION/ /opt/grouper/grouper.clientBinary/
COPY --from=installing /opt/grouper/$GROUPER_VERSION/apache-tomcat-$TOMCAT_VERSION/ /opt/tomcat/
COPY --from=installing /opt/grouper/$GROUPER_VERSION/apache-tomee-webprofile-$TOMEE_VERSION/ /opt/tomee/
COPY --from=installing /etc/alternatives/java /etc/alternatives/java

ADD https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-core/2.11.0/log4j-core-2.11.0.jar /opt/tomcat/bin
ADD https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-api/2.11.0/log4j-api-2.11.0.jar /opt/tomcat/bin
ADD https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-jul/2.11.0/log4j-jul-2.11.0.jar /opt/tomcat/bin

ADD https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-core/2.11.0/log4j-core-2.11.0.jar /opt/tomee/bin
ADD https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-api/2.11.0/log4j-api-2.11.0.jar /opt/tomee/bin
ADD https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-jul/2.11.0/log4j-jul-2.11.0.jar /opt/tomee/bin

RUN cd /opt/grouper/grouper.apiBinary/; \
rm -fr ddlScripts/ grouper.properties grouper.lck grouper.log grouper.script grouper.tmp/ gshAddGrouperSystemWsGroup.gsh logs/

RUN cd /opt/tomcat/; \
chmod +r bin/log4j-*.jar; \
rm -fr webapps/docs/ webapps/examples/ webapps/host-manager/ webapps/manager/ webapps/ROOT/ logs/* temp/* work/* conf/logging.properties

RUN cd /opt/tomee/; \
chmod +r bin/log4j-*.jar; \
rm -fr webapps/docs/ webapps/host-manager/ webapps/manager/ logs/* temp/* work/* conf/logging.properties

COPY container_files/api/* /opt/grouper/grouper.apiBinary/conf/
COPY container_files/ui/ /opt/grouper/grouper.ui/WEB-INF/
COPY container_files/ws/ /opt/grouper/grouper.ws/WEB-INF/
COPY container_files/tomcat/ /opt/tomcat/
COPY container_files/tomee/ /opt/tomee/


FROM tier/shibboleth_sp:3.0.4_03122019

LABEL author="tier-packaging@internet2.edu <tier-packaging@internet2.edu>" \
Vendor="TIER" \
ImageType="Grouper" \
ImageName=$imagename \
ImageOS=centos7

ARG GROUPER_CONTAINER_VERSION

ENV JAVA_HOME=/usr/lib/jvm/zulu-8/ \
PATH=$PATH:$JAVA_HOME/bin \
GROUPER_HOME=/opt/grouper/grouper.apiBinary \
GROUPER_CONTAINER_VERSION=$GROUPER_CONTAINER_VERSION

RUN ln -sf /usr/share/zoneinfo/UTC /etc/localtime

RUN yum update -y \
&& yum install -y cron logrotate python-pip \
&& pip install --upgrade pip \
&& pip install supervisor \
&& yum clean -y all

COPY --from=installing $JAVA_HOME $JAVA_HOME
COPY --from=cleanup /opt/tomcat/ /opt/tomcat/
COPY --from=cleanup /opt/tomee/ /opt/tomee/
COPY --from=cleanup /opt/grouper/ /opt/grouper/

RUN groupadd -r tomcat \
&& useradd -r -m -s /sbin/nologin -g tomcat tomcat \
&& mkdir -p /opt/tomcat/logs/ /opt/tomcat/temp/ /opt/tomcat/work/ \
&& chown -R tomcat:tomcat /opt/tomcat/logs/ /opt/tomcat/temp/ /opt/tomcat/work/ \
&& chown -R tomcat:tomcat /opt/tomee/logs/ /opt/tomee/temp/ /opt/tomee/work/ \
&& ln -s $JAVA_HOME/bin/java /etc/alternatives/java

# does shib sp3 not generate these files?
# RUN rm /etc/shibboleth/sp-key.pem /etc/shibboleth/sp-cert.pem

COPY container_files/tier-support/ /opt/tier-support/
COPY container_files/usr-local-bin/ /usr/local/bin/
COPY container_files/httpd/* /etc/httpd/conf.d/
COPY container_files/shibboleth/* /etc/shibboleth/

WORKDIR /opt/grouper/$version
RUN cp /dev/null /etc/httpd/conf.d/ssl.conf \
&& sed -i 's/LogFormat "/LogFormat "httpd;access_log;%{ENV}e;%{USERTOKEN}e;/g' /etc/httpd/conf/httpd.conf \
&& echo -e "\nErrorLogFormat \"httpd;error_log;%{ENV}e;%{USERTOKEN}e;[%{u}t] [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a] %M% ,\ referer\ %{Referer}i\"" >> /etc/httpd/conf/httpd.conf \
&& sed -i 's/CustomLog "logs\/access_log"/CustomLog "\/tmp\/logpipe"/g' /etc/httpd/conf/httpd.conf \
&& sed -i 's/ErrorLog "logs\/error_log"/ErrorLog "\/tmp\/logpipe"/g' /etc/httpd/conf/httpd.conf \
&& echo -e "\nPassEnv ENV" >> /etc/httpd/conf/httpd.conf \
&& echo -e "\nPassEnv USERTOKEN" >> /etc/httpd/conf/httpd.conf

#VOLUME /opt/grouper/2.3.0/apache-tomcat-$TOMCAT_VERSION/logs
WORKDIR /opt/grouper/grouper.apiBinary/

EXPOSE 8080 8009 8005
EXPOSE 80 443

ADD files/bin/setenv.sh /opt/tier/setenv.sh
RUN chmod +x /opt/tier/setenv.sh
ADD files/bin/startup.sh /usr/bin/startup.sh
RUN chmod +x /usr/bin/startup.sh
ADD files/bin/sendtierbeacon.sh /usr/bin/sendtierbeacon.sh
RUN chmod +x /usr/bin/sendtierbeacon.sh
HEALTHCHECK NONE

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

CMD ["/usr/bin/startup.sh"]
CMD ["bin/gsh", "-loader"]