From f43f9ee427709b88be355b8caae8e6b3487c655c Mon Sep 17 00:00:00 2001 From: Chris Hyzer Date: Thu, 28 Jan 2021 02:32:40 -0500 Subject: [PATCH] fix openshift --- Dockerfile | 9 +++------ .../tier-support/test/testContainer.Dockerfile | 4 ++-- container_files/usr-local-bin/changeGid.sh | 4 ++-- container_files/usr-local-bin/changeUid.sh | 4 ++-- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index c4e417f1..04624129 100644 --- a/Dockerfile +++ b/Dockerfile @@ -84,14 +84,11 @@ 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 \ - && chown -R tomcat:tomcat /opt/tomee \ && rm -f /etc/alternatives/java \ && ln -s $JAVA_HOME/bin/java /etc/alternatives/java \ && mkdir -p /opt/tomee/conf/Catalina/localhost/ \ - && chown -R tomcat:tomcat /opt/grouper \ - && mkdir /opt/hsqldb \ - && chown tomcat:tomcat /opt/hsqldb - + && mkdir /opt/hsqldb + COPY container_files/tier-support/ /opt/tier-support/ COPY container_files/usr-local-bin/ /usr/local/bin/ RUN chmod +x /usr/local/bin/*.sh @@ -102,7 +99,7 @@ RUN cp /dev/null /etc/httpd/conf.d/ssl.conf # this is to improve openshift RUN touch /opt/grouper/grouperEnv.sh \ && mkdir -p /opt/tomee/work/Catalina/localhost/ \ - && chgrp -R root /opt/grouper/ /etc/httpd/conf/ /home/tomcat/ /opt/tomee/ /usr/local/bin /etc/httpd/conf.d/ /opt/hsqldb/ /opt/tier-support/ \ + && chown -R tomcat:root /opt/grouper/ /etc/httpd/conf/ /home/tomcat/ /opt/tomee/ /usr/local/bin /etc/httpd/conf.d/ /opt/hsqldb/ /opt/tier-support/ \ && chmod -R g+rwx /opt/grouper/ /etc/httpd/conf/ /home/tomcat/ /opt/tomee/ /usr/local/bin /etc/httpd/conf.d/ /opt/hsqldb/ /opt/tier-support/ # keep backup of files diff --git a/container_files/tier-support/test/testContainer.Dockerfile b/container_files/tier-support/test/testContainer.Dockerfile index 2768d082..7f3ccd83 100644 --- a/container_files/tier-support/test/testContainer.Dockerfile +++ b/container_files/tier-support/test/testContainer.Dockerfile @@ -7,5 +7,5 @@ FROM i2incommon/grouper:2.5.40 # this will overlay all the files from /opt/grouperContainer/slashRoot on to / COPY slashRoot / -RUN chown -R tomcat:tomcat /opt/grouper \ - && chown -R tomcat:tomcat /opt/tomee \ No newline at end of file +RUN chown -R tomcat:root /opt/grouper \ + && chown -R tomcat:root /opt/tomee \ No newline at end of file diff --git a/container_files/usr-local-bin/changeGid.sh b/container_files/usr-local-bin/changeGid.sh index b4e979da..6d55d94d 100755 --- a/container_files/usr-local-bin/changeGid.sh +++ b/container_files/usr-local-bin/changeGid.sh @@ -14,5 +14,5 @@ getentOutput="$(getent group "$groupname")" oldGid="$( echo "$getentOutput" |cut -d\: -f3 )" groupmod -g "$newGid" "$groupname" echo "grouperContainer; INFO: (changeGid.sh) groupmod -g \"$newGid\" \"$groupname\" , result: $?" -find / -xdev -type d -group "$oldGid" -exec chgrp -h "$groupname" {} \; -echo "grouperContainer; INFO: (changeGid.sh) find / -xdev -type d -group \"$oldGid\" -exec chgrp -h \"$groupname\" {} \; , result: $?" +find / -xdev -group "$oldGid" -exec chgrp -h "$groupname" {} \; +echo "grouperContainer; INFO: (changeGid.sh) find / -xdev -group \"$oldGid\" -exec chgrp -h \"$groupname\" {} \; , result: $?" diff --git a/container_files/usr-local-bin/changeUid.sh b/container_files/usr-local-bin/changeUid.sh index fff9c631..2dcf8a83 100755 --- a/container_files/usr-local-bin/changeUid.sh +++ b/container_files/usr-local-bin/changeUid.sh @@ -13,5 +13,5 @@ newUid=$2 oldUid="$(id -u "$username")" usermod -u "$newUid" "$username" echo "grouperContainer; INFO: (changeUid.sh) usermod -u \"$newUid\" \"$username\" , result: $?" -find / -xdev -type d -user "$oldUid" -exec chown -h "$username" {} \; -echo "grouperContainer; INFO: (changeUid.sh) find / -xdev -type d -user \"$oldUid\" -exec chown -h \"$username\" {} \; , result: $?" +find / -xdev -user "$oldUid" -exec chown -h "$username" {} \; +echo "grouperContainer; INFO: (changeUid.sh) find / -xdev -user \"$oldUid\" -exec chown -h \"$username\" {} \; , result: $?"