Skip to content

Commit

Permalink
fix openshift
Browse files Browse the repository at this point in the history
  • Loading branch information
mchyzer committed Jan 28, 2021
1 parent 732a0e1 commit f43f9ee
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
9 changes: 3 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions container_files/tier-support/test/testContainer.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
RUN chown -R tomcat:root /opt/grouper \
&& chown -R tomcat:root /opt/tomee
4 changes: 2 additions & 2 deletions container_files/usr-local-bin/changeGid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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: $?"
4 changes: 2 additions & 2 deletions container_files/usr-local-bin/changeUid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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: $?"

0 comments on commit f43f9ee

Please sign in to comment.