Feature request: find and run any customer-specific init scripts at the tail end of `entrypoint.sh`
Proposal
As a fortify image consumer it would be helpful to be able to layer in additional init scripts via a volume mount in order to further customize the startup and runtime behavior of SSC. The current entrypoint.sh looks like a good spot to layer that in, something like this:
# snipped from the end of scripts/entrypoint.sh
#
# Render server configuration template and start Tomcat
#
setupTomcatConfig() {
local tmp; tmp="$(mktemp "$APP_ETC/server.xml.XXXXXXXXX")"
java "$APP_HOME/tools/AttributeTemplateRenderer.java" "$CATALINA_HOME/conf/server-tpl.xml" "${tmp}"
chmod 00440 "${tmp}"
mv "${tmp}" "$1"
}
setupTomcatConfig "$APP_ETC/server.xml"
### ⭐ BEGIN PROPOSED CHANGE ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐
echo "Finding and loading all Ironbank custom init scripts immediately prior to app server boot..."
for file in /opt/ironbank/init/**.sh; do
. file
done
echo "Ironbank custom init scripts loaded, proceeding with app server boot [catalina.sh]..."
### ⭐ END PROPOSED CHANGE ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐
exec /bin/bash ${CONTAINER_DEBUG:+-x} "${CATALINA_HOME}/bin/catalina.sh" "$@"
exit 9
Background
As a BigBang mission team engineer working with the fortify
helm chart I've been having a surprisingly complex time trying to overlay a persistent customizable log4j config using helm values at $COM_FORTIFY_SSC_HOME/conf/log4j2.xml
.
The SSC app server looks there for log config at runtime, but for customers upgrading an existing SSC deployment it's proven to be difficult to override that file given the current "mount /fortify
as a persistent volume" approach taken in the fortify
chart.