Fix exec function when running the container as root

pull/97/head
Jean Pommier 2024-09-25 16:48:31 +02:00
parent 245d346801
commit a306878d8a
1 changed files with 6 additions and 3 deletions

View File

@ -168,7 +168,8 @@ if [ -n "$GEOSERVER_ADMIN_PASSWORD" ] && [ -n "$GEOSERVER_ADMIN_USER" ]; then
fi fi
# Run as non-privileged user # Run as non-privileged user
if [ "${RUN_UNPRIVILEGED}" = "true" ]; then if [ "${RUN_UNPRIVILEGED}" = "true" ]
then
echo "The server will be run as non-privileged user 'tomcat'" echo "The server will be run as non-privileged user 'tomcat'"
RUN_WITH_USER_UID=${RUN_WITH_USER_UID:=999} RUN_WITH_USER_UID=${RUN_WITH_USER_UID:=999}
@ -184,6 +185,8 @@ if [ "${RUN_UNPRIVILEGED}" = "true" ]; then
chown -R tomcat:tomcat $CHANGE_OWNERSHIP_ON_FOLDERS chown -R tomcat:tomcat $CHANGE_OWNERSHIP_ON_FOLDERS
fi fi
exec gosu tomcat $CATALINA_HOME/bin/catalina.sh run -Dorg.apache.catalina.connector.RECYCLE_FACADES=true
else
exec $CATALINA_HOME/bin/catalina.sh run -Dorg.apache.catalina.connector.RECYCLE_FACADES=true
fi fi
exec gosu tomcat $CATALINA_HOME/bin/catalina.sh run -Dorg.apache.catalina.connector.RECYCLE_FACADES=true