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: main
Choose a base ref
...
head repository: docker/grouper
compare: feature/grp-5135-rewrite-installer
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Feb 11, 2020

  1. Update Dockerfile

    chubing committed Feb 11, 2020
    Copy the full SHA
    b85cda4 View commit details
  2. Copy the full SHA
    e971290 View commit details
  3. Copy the full SHA
    a57566b View commit details
  4. Update Dockerfile

    chubing committed Feb 11, 2020
    Copy the full SHA
    5e1d061 View commit details
  5. Copy the full SHA
    9c457e5 View commit details

Commits on Feb 13, 2020

  1. Copy the full SHA
    95cce47 View commit details
  2. Update Dockerfile

    chubing committed Feb 13, 2020
    Copy the full SHA
    06f7782 View commit details
  3. Copy the full SHA
    88a1da5 View commit details
  4. Delete web.xml

    chubing committed Feb 13, 2020
    Copy the full SHA
    bde3787 View commit details
  5. Update grouper-www.conf

    chubing committed Feb 13, 2020
    Copy the full SHA
    1ace64a View commit details
  6. Delete grouper-ws-scim.xml

    chubing committed Feb 13, 2020
    Copy the full SHA
    8c979d5 View commit details
  7. Delete grouper-ws.xml

    chubing committed Feb 13, 2020
    Copy the full SHA
    f098964 View commit details
  8. Update grouper.xml

    chubing committed Feb 13, 2020
    Copy the full SHA
    142820e View commit details
  9. Update library.sh

    chubing committed Feb 13, 2020
    Copy the full SHA
    c96c12b View commit details
  10. Update Dockerfile

    chubing committed Feb 13, 2020
    Copy the full SHA
    c39255a View commit details
  11. Update Dockerfile

    chubing committed Feb 13, 2020
    Copy the full SHA
    4068359 View commit details
  12. Update Dockerfile

    chubing committed Feb 13, 2020
    Copy the full SHA
    166e61f View commit details
  13. Update Dockerfile

    chubing committed Feb 13, 2020
    Copy the full SHA
    8aa7b99 View commit details
  14. Copy the full SHA
    30d275b View commit details
  15. Copy the full SHA
    d3c6758 View commit details
  16. enabling tests

    chubing committed Feb 13, 2020
    Copy the full SHA
    dbc87bb View commit details
  17. Update Dockerfile

    chubing committed Feb 13, 2020
    Copy the full SHA
    6eefaba View commit details
  18. Update Dockerfile

    chubing committed Feb 13, 2020
    Copy the full SHA
    e393bd0 View commit details
  19. Update Jenkinsfile

    chubing committed Feb 13, 2020
    Copy the full SHA
    ffbcefe View commit details
  20. fix grouper_home

    chubing committed Feb 13, 2020
    Copy the full SHA
    331a1c7 View commit details

Commits on Feb 16, 2020

  1. Update Dockerfile

    chubing committed Feb 16, 2020
    Copy the full SHA
    8e489c3 View commit details

Commits on Feb 17, 2020

  1. Update Dockerfile

    chubing committed Feb 17, 2020
    Copy the full SHA
    e4da113 View commit details
  2. Update Dockerfile

    chubing committed Feb 17, 2020
    Copy the full SHA
    f0ba413 View commit details
  3. Update Dockerfile

    chubing committed Feb 17, 2020
    Copy the full SHA
    d129666 View commit details
  4. Update Dockerfile

    chubing committed Feb 17, 2020
    Copy the full SHA
    620c33d View commit details
  5. Update Dockerfile

    chubing committed Feb 17, 2020
    Copy the full SHA
    b9814f6 View commit details
  6. Update Dockerfile

    chubing committed Feb 17, 2020
    Copy the full SHA
    ee1285a View commit details
  7. Update Dockerfile

    chubing committed Feb 17, 2020
    Copy the full SHA
    ab16d9a View commit details
  8. Update Dockerfile

    chubing committed Feb 17, 2020
    Copy the full SHA
    4b7ce76 View commit details
  9. update GROUPER_HOME

    chubing committed Feb 17, 2020
    Copy the full SHA
    5f68f61 View commit details
  10. correto java jvm

    chubing committed Feb 17, 2020
    Copy the full SHA
    b54716d View commit details
  11. Copy the full SHA
    46905d0 View commit details
  12. Update Dockerfile

    chubing committed Feb 17, 2020
    Copy the full SHA
    ed705f6 View commit details
  13. Update main.bats

    chubing committed Feb 17, 2020
    Copy the full SHA
    bb0e780 View commit details
  14. Update library.sh

    chubing committed Feb 17, 2020
    Copy the full SHA
    72f3e6f View commit details
  15. Update main.bats

    chubing committed Feb 17, 2020
    Copy the full SHA
    63d42f8 View commit details
  16. Create morphString.properties

    chubing committed Feb 17, 2020
    Copy the full SHA
    a96ab7f View commit details
  17. Update docker-compose.yml

    chubing committed Feb 17, 2020
    Copy the full SHA
    719997c View commit details
  18. Update docker-compose.yml

    chubing committed Feb 17, 2020
    Copy the full SHA
    bbf2b4e View commit details

Commits on Feb 18, 2020

  1. updates for 2.5

    chubing committed Feb 18, 2020
    Copy the full SHA
    55d16d2 View commit details
  2. Update main.bats

    chubing committed Feb 18, 2020
    Copy the full SHA
    4cd026c View commit details
  3. remove other JVM references

    chubing committed Feb 18, 2020
    Copy the full SHA
    778c111 View commit details
  4. Update Jenkinsfile

    chubing committed Feb 18, 2020
    Copy the full SHA
    d4f0011 View commit details
  5. Update supervisord-tomee.conf

    chubing committed Feb 18, 2020
    Copy the full SHA
    8920eb3 View commit details

Commits on Feb 20, 2020

  1. Update README.md

    chubing committed Feb 20, 2020
    Copy the full SHA
    611456d View commit details
Showing with 4,599 additions and 2,055 deletions.
  1. +2 −0 .gitignore
  2. +80 −124 Dockerfile
  3. +6 −0 Dockerfile3
  4. +59 −0 Dockerfile_centos
  5. +71 −26 Jenkinsfile
  6. +1 −1 LICENSE
  7. +4 −367 README.md
  8. +3 −0 build.sh
  9. +3 −0 build3.sh
  10. +1 −1 common.bash
  11. +0 −144 container_files/api/log4j.properties
  12. +52 −0 container_files/certs/localhost.key
  13. +34 −0 container_files/certs/localhost.pem
  14. +218 −0 container_files/docker-build-bin/containerDockerfileInstallGrouper.sh
  15. +3 −44 container_files/grouper.installer.properties
  16. 0 container_files/grouperWebapp/WEB-INF/classes/log4j2.additionalAppenders.xml.txt
  17. 0 container_files/grouperWebapp/WEB-INF/classes/log4j2.additionalLoggers.xml.txt
  18. +214 −0 container_files/grouperWebapp/WEB-INF/classes/log4j2.xml
  19. +0 −20 container_files/httpd/grouper-www.conf
  20. +0 −28 container_files/httpd/ssl-enabled.conf
  21. +30 −0 container_files/java-corretto/corretto-signing-key.pub
  22. +0 −153 container_files/shibboleth/attribute-map.xml
  23. +0 −39 container_files/shibboleth/native.logger
  24. +0 −59 container_files/shibboleth/shibd.logger
  25. +0 −6 container_files/tier-support/grouper-ws-scim.xml
  26. +0 −4 container_files/tier-support/grouper-ws.xml
  27. +0 −4 container_files/tier-support/grouper.xml
  28. BIN container_files/tier-support/log4j_fix/tomcatBin/log4j-api-2.17.1.jar
  29. BIN container_files/tier-support/log4j_fix/tomcatBin/log4j-core-2.17.1.jar
  30. BIN container_files/tier-support/log4j_fix/tomcatBin/log4j-jul-2.17.1.jar
  31. BIN container_files/tier-support/log4j_fix/tomcatLib/slf4j-api-1.7.32.jar
  32. BIN container_files/tier-support/log4j_fix/tomcatLib/slf4j-jdk14-1.7.32.jar
  33. BIN container_files/tier-support/log4j_fix/webinfLib/log4j-1.2-api-2.17.1.jar
  34. BIN container_files/tier-support/log4j_fix/webinfLib/slf4j-api-1.7.32.jar
  35. +0 −39 container_files/tier-support/supervisord-tomcat.conf
  36. +0 −31 container_files/tier-support/supervisord-tomee.conf
  37. BIN container_files/tier-support/test/TestSsl.class
  38. +39 −0 container_files/tier-support/test/TestSsl.java
  39. +26 −0 container_files/tier-support/test/docker-compose.yaml.txt
  40. +122 −0 container_files/tier-support/test/get_tls_cert.py
  41. +87 −0 container_files/tier-support/test/grouperContainerUnitTest.sh
  42. +56 −0 container_files/tier-support/test/grouperContainerUnitTestDaemon.sh
  43. +259 −0 container_files/tier-support/test/grouperContainerUnitTestLibrary.sh
  44. +111 −0 container_files/tier-support/test/grouperContainerUnitTestQuickstart.sh
  45. +51 −0 container_files/tier-support/test/grouperContainerUnitTestSelfSigned.sh
  46. +39 −0 container_files/tier-support/test/grouperContainerUnitTestSlashRoot.sh
  47. +86 −0 container_files/tier-support/test/grouperContainerUnitTestUi.sh
  48. +51 −0 container_files/tier-support/test/grouperContainerUnitTestUi2.sh
  49. +39 −0 container_files/tier-support/test/grouperContainerUnitTestUiDifferentPorts.sh
  50. +58 −0 container_files/tier-support/test/grouperContainerUnitTestUiNoSsl.sh
  51. +37 −0 container_files/tier-support/test/grouperContainerUnitTestUiNoSslOrClient.sh
  52. +77 −0 container_files/tier-support/test/grouperContainerUnitTestUiSubimage.sh
  53. +78 −0 container_files/tier-support/test/grouperContainerUnitTestUiSubimageNonroot.sh
  54. +67 −0 container_files/tier-support/test/grouperContainerUnitTestWs.sh
  55. +67 −0 container_files/tier-support/test/grouperContainerUnitTestWsAuthn.sh
  56. +30 −0 container_files/tier-support/test/rebuildTestContainer.sh
  57. +10 −0 container_files/tier-support/test/testContainer.Dockerfile
  58. +41 −0 container_files/tier-support/web.wsTomcatAuthn.xml
  59. +6 −2 container_files/tomcat/bin/setenv.sh
  60. +3 −0 container_files/tomcat/conf/Catalina/localhost/grouper.xml
  61. +1 −0 container_files/tomcat/conf/Catalina/localhost/rewrite.config.grouper
  62. +2 −0 container_files/tomcat/conf/createPatches.txt
  63. +0 −26 container_files/tomcat/conf/log4j2.xml
  64. +47 −25 container_files/{tomee/conf/server.xml → tomcat/conf/server.xml.grouper}
  65. +55 −0 container_files/tomcat/conf/server.xml.grouper.patch
  66. +25 −18 container_files/tomcat/conf/{server.xml → server.xml.original}
  67. +3 −3 container_files/tomcat/conf/tomcat-users.xml
  68. +0 −3 container_files/tomee/bin/setenv.sh
  69. +0 −26 container_files/tomee/conf/log4j2.xml
  70. +0 −51 container_files/tomee/conf/tomcat-users.xml
  71. +0 −12 container_files/ui/classes/grouper-ui.properties
  72. +0 −144 container_files/ui/classes/log4j.properties
  73. +0 −89 container_files/ui/web.xml
  74. +23 −0 container_files/usr-local-bin/changeGid.sh
  75. +22 −0 container_files/usr-local-bin/changeUid.sh
  76. +107 −0 container_files/usr-local-bin/containerDockerfileInstallPermissions.sh
  77. +11 −0 container_files/usr-local-bin/containerPing
  78. +4 −6 container_files/usr-local-bin/daemon
  79. +34 −3 container_files/usr-local-bin/entrypoint.sh
  80. +6 −0 container_files/usr-local-bin/grouperScriptHooks.sh
  81. +57 −0 container_files/usr-local-bin/grouperScriptHooksBase.sh
  82. +10 −0 container_files/usr-local-bin/grouperTestFileExist.sh
  83. +11 −0 container_files/usr-local-bin/grouperTestPrintEnv.sh
  84. +17 −4 container_files/usr-local-bin/gsh
  85. +34 −148 container_files/usr-local-bin/library.sh
  86. +445 −0 container_files/usr-local-bin/libraryPrep.sh
  87. +98 −0 container_files/usr-local-bin/libraryPrepOnly.sh
  88. +28 −0 container_files/usr-local-bin/libraryRunCommand.sh
  89. +435 −0 container_files/usr-local-bin/librarySetupFiles.sh
  90. +84 −0 container_files/usr-local-bin/librarySetupFilesForComponent.sh
  91. +599 −0 container_files/usr-local-bin/librarySetupFilesTomcat.sh
  92. +10 −0 container_files/usr-local-bin/quickstart
  93. +0 −7 container_files/usr-local-bin/scim
  94. +4 −6 container_files/usr-local-bin/ui
  95. +5 −7 container_files/usr-local-bin/ui-ws
  96. +4 −4 container_files/usr-local-bin/ws
  97. +0 −144 container_files/ws/classes/log4j.properties
  98. +1 −1 manualBuild.sh
  99. +3 −0 rm.sh
  100. +17 −0 run.sh
  101. +4 −0 run2.sh
  102. +23 −0 run3.sh
  103. +3 −0 ssh.sh
  104. +3 −0 ssh3.sh
  105. +0 −2 test-compose/README.md
  106. +0 −2 test-compose/configs-and-secrets/grouper/grouper.hibernate.properties
  107. +1 −0 test-compose/configs-and-secrets/grouper/morphString.properties
  108. +1 −1 test-compose/daemon/Dockerfile
  109. +11 −9 test-compose/data/Dockerfile
  110. +112 −0 test-compose/data/container_files/conf/grouper.client.properties
  111. +0 −2 test-compose/data/container_files/conf/grouper.hibernate.properties
  112. +1 −0 test-compose/data/container_files/conf/morphString.properties
  113. +5 −50 test-compose/docker-compose.yml
  114. +1 −1 test-compose/gsh/Dockerfile
  115. +0 −8 test-compose/scim/Dockerfile
  116. +0 −51 test-compose/scim/container_files/tomcat-users.xml
  117. +0 −30 test-compose/scim/container_files/web.xml
  118. +1 −1 test-compose/ui/Dockerfile
  119. +0 −69 test-compose/ui/container_files/shibboleth/shibd.logger
  120. +1 −1 test-compose/ws/Dockerfile
  121. +9 −9 tests/main.bats
2 changes: 2 additions & 0 deletions .gitignore
@@ -7,3 +7,5 @@ bin/run.sh
bin/start.sh
bin/stop.sh
bin/test.sh
/.project
**/*~
204 changes: 80 additions & 124 deletions Dockerfile
@@ -1,154 +1,110 @@
FROM centos:centos7 as installing
ARG GROUPER_CONTAINER_VERSION=5.9.1
ARG GROUPER_VERSION=5.9.1
ARG JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto

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

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
FROM --platform=$TARGETPLATFORM rockylinux:8.8 as os-base

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

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
# net-tools curl mlocate strace telnet man vim rsyslog cron mod_ssl cronie
RUN yum update -y \
&& yum install -y logrotate python3-pip rsync sudo patch wget tar unzip dos2unix file net-tools diffutils curl mlocate strace telnet man vim rsyslog cronie findutils procps \
&& pip3 install --upgrade setuptools \
&& yum clean -y all

# Install Corretto Java JDK (newer more arch independent way)
RUN rpm --import https://yum.corretto.aws/corretto.key \
&& curl -L -o /etc/yum.repos.d/corretto.repo https://yum.corretto.aws/corretto.repo \
&& yum install -y java-17-amazon-corretto-devel

RUN groupadd -g 994 -r tomcat \
&& useradd -u 996 -r -m -s /sbin/nologin -g tomcat tomcat

FROM centos:centos7 as cleanup

ENV GROUPER_VERSION=2.4.0 \
TOMCAT_VERSION=8.5.42 \
TOMEE_VERSION=7.0.0
FROM os-base as stage

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
ARG GROUPER_CONTAINER_VERSION
ARG GROUPER_VERSION
ARG JAVA_HOME

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
ENV GROUPER_VERSION=$GROUPER_VERSION \
GROUPER_CONTAINER_VERSION=GROUPER_CONTAINER_VERSION \
JAVA_HOME=$JAVA_HOME \
PATH=$PATH:$JAVA_HOME/bin \
GROUPER_HOME=/opt/grouper/grouperWebapp/WEB-INF

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
# real copy command (if not caching), uncomment this and change comments of COPY above to work on install script
COPY container_files/ /tmp/container_files/

RUN cd /opt/grouper/grouper.apiBinary/; \
rm -fr ddlScripts/ grouper.properties grouper.lck grouper.log grouper.script grouper.tmp/ gshAddGrouperSystemWsGroup.gsh logs/
# TODO put this back in one command
RUN chmod +x /tmp/container_files/docker-build-bin/*.sh
#(DEPRECATED) RUN /tmp/container_files/docker-build-bin/containerDockerfileInstallDos2unix.sh /tmp/container_files
RUN /tmp/container_files/docker-build-bin/containerDockerfileInstallGrouper.sh $JAVA_HOME $GROUPER_VERSION
#(DEPRECATED) RUN /opt/container_files/docker-build-bin/containerDockerfileInstall.sh $JAVA_HOME $GROUPER_VERSION

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
# Temp adjustments

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 stage
#
# ARG GROUPER_CONTAINER_VERSION
# ARG GROUPER_VERSION
# ARG JAVA_HOME
#
# ENV GROUPER_VERSION=$GROUPER_VERSION \
# GROUPER_CONTAINER_VERSION=GROUPER_CONTAINER_VERSION \
# JAVA_HOME=$JAVA_HOME \
# PATH=$PATH:$JAVA_HOME/bin \
# GROUPER_HOME=/opt/grouper/grouperWebapp/WEB-INF
#
# COPY container_files/ /opt/container_files/
#
# RUN /opt/container_files/docker-build-bin/containerDockerfileInstallGrouperTEMP.sh $JAVA_HOME $GROUPER_VERSION
#


FROM tier/shibboleth_sp:3.0.4_03122019
FROM os-base as grouper

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

ARG GROUPER_CONTAINER_VERSION
ARG GROUPER_VERSION
ARG JAVA_HOME

ENV JAVA_HOME=/usr/lib/jvm/zulu-8/ \
ENV GROUPER_VERSION=$GROUPER_VERSION \
GROUPER_CONTAINER_VERSION=$GROUPER_VERSION \
JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto \
PATH=$PATH:$JAVA_HOME/bin \
GROUPER_HOME=/opt/grouper/grouper.apiBinary \
GROUPER_CONTAINER_VERSION=$GROUPER_CONTAINER_VERSION
GROUPER_HOME=/opt/grouper/grouperWebapp/WEB-INF

COPY --from=stage /tmp/stage/grouper/$GROUPER_VERSION/container /opt

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/

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
RUN ln -sf /usr/share/zoneinfo/UTC /etc/localtime \
&& rm -f /etc/alternatives/java \
&& ln -s $JAVA_HOME/bin/java /etc/alternatives/java \
&& chmod u+w $JAVA_HOME/lib/security/cacerts \
&& /usr/lib/jvm/java/bin/keytool -import -noprompt -cacerts -storepass changeit -alias "localhost" -file "/opt/grouper/certs/localhost.pem" \
&& chmod u-w $JAVA_HOME/lib/security/cacerts \
&& echo 'umask 002' >> /home/tomcat/.bashrc

# RUN /usr/local/bin/containerDockerfileInstallPermissions.sh tomcat root

WORKDIR /opt/grouper/grouper.apiBinary/

EXPOSE 80 443
# testing container
# see output with docker build . --tag my:grouper
# DOCKER_BUILDKIT=0 docker build --progress=plain -t mygrouper .
# docker run --detach --name mygrouper mygrouper:latest
# docker exec -it mygrouper bash

WORKDIR /opt/grouper/grouperWebapp/WEB-INF/
EXPOSE 80 443 8080 8443
HEALTHCHECK NONE

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

CMD ["bin/gsh", "-loader"]
#ENTRYPOINT ["ping"]
#CMD ["google.com"]
6 changes: 6 additions & 0 deletions Dockerfile3
@@ -0,0 +1,6 @@
FROM i2incommon/grouper:5.7.0

COPY container_files/usr-local-bin /usr/local/bin
COPY container_files /opt

EXPOSE 8080 8443 8009
59 changes: 59 additions & 0 deletions Dockerfile_centos
@@ -0,0 +1,59 @@
FROM i2incommon/grouper:4.1.5 as grouperContainer

FROM centos:centos7

COPY --from=grouperContainer /opt /opt
COPY --from=grouperContainer /usr/local/bin /usr/local/bin


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

ARG GROUPER_CONTAINER_VERSION

ENV GROUPER_VERSION=4.1.5 \
GROUPER_CONTAINER_VERSION=4.1.5 \
JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto \
PATH=$PATH:$JAVA_HOME/bin \
GROUPER_HOME=/opt/grouper/grouperWebapp/WEB-INF

# net-tools curl mlocate strace telnet man vim rsyslog cron httpd mod_ssl cronie

RUN rm -fr /var/cache/yum/* && yum clean all && yum -y install --setopt=tsflags=nodocs epel-release \
&& yum update -y \
&& yum install -y logrotate python3-pip rsync sudo patch supervisor wget tar unzip dos2unix file net-tools curl mlocate logrotate strace telnet man vim rsyslog cronie httpd mod_ssl findutils \
&& pip3 install --upgrade setuptools \
&& yum clean -y all \
&& groupadd -r tomcat \
&& useradd -r -m -s /sbin/nologin -g tomcat tomcat

# Install Corretto Java JDK
#Corretto download page: https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/downloads-list.html

# Install Corretto Java JDK (newer more arch independent way)
RUN rpm --import https://yum.corretto.aws/corretto.key \
&& curl -L -o /etc/yum.repos.d/corretto.repo https://yum.corretto.aws/corretto.repo \
&& yum install -y java-17-amazon-corretto-devel

RUN /usr/local/bin/containerDockerfileInstallPermissions.sh tomcat root

# testing container
# docker build -f Dockerfile_centos -t mygrouper
# see output with
# DOCKER_BUILDKIT=0 docker build --progress=plain -t mygrouper .
# docker run --detach --name mygrouper mygrouper:latest
# docker exec -it mygrouper bash
# docker run --detach -e GROUPER_SELF_SIGNED_CERT=true -e GROUPER_MAX_MEMORY='3g' -e GROUPER_RUN_SHIB_SP=false -e GROUPERSYSTEM_QUICKSTART_PASS=pass -e GROUPER_UI_GROUPER_AUTH=true -e GROUPER_DATABASE_URL=jdbc:postgresql://host.docker.internal:5433/grouper -e GROUPER_DATABASE_USERNAME=grouper -e GROUPER_DATABASE_PASSWORD=pass -e GROUPER_AUTO_DDL_UPTOVERSION='v4.*.*' -e GROUPER_UI_CONFIGURATION_EDITOR_SOURCEIPADDRESSES='0.0.0.0/0' -e GROUPER_START_DELAY_SECONDS=10 --publish 8081:8080 -e GROUPER_RUN_APACHE=false --name mygrouper mygrouper:latest ui



WORKDIR /opt/grouper/grouperWebapp/WEB-INF/
EXPOSE 80 443
HEALTHCHECK NONE

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
#ENTRYPOINT ["ping"]
#CMD ["google.com"]