-
Notifications
You must be signed in to change notification settings - Fork 0
Labels
Description
We need to refactor the Metacat Docker image to support overlaying arbitrary files onto a deployed image. This feature is required to handle new OSTI eLink jar files, but it should be general enough to allow any file path to be rsynced to /usr/local/tomcat/webapps/$METACAT_APP_CONTEXT.
Implementation Steps
- Modify the
docker-entrypoint.shscript to include logic that rsyncs any files placed in/tmp/files(with relative paths) to/usr/local/tomcat/webapps/$METACAT_APP_CONTEXTafter the app context directory is set up. - Ensure that the skins also use this general method for file overlay.
- Solicit feedback and suggestions from the maintainers on the proposed approach.
Snippet for docker-entrypoint.sh
Insert the following snippet to sync arbitrary files placed in /tmp/files to /usr/local/tomcat/webapps/$METACAT_APP_CONTEXT:
# Overlay arbitrary files
if [ -d /tmp/files ]; then
echo
echo '**************************************'
echo "Overlaying files from /tmp/files"
echo '**************************************'
echo
rsync -av /tmp/files/ /usr/local/tomcat/webapps/$METACAT_APP_CONTEXT/
fiThis snippet should be placed before the line that starts Tomcat:
# Insert here before Tomcat start
# Start tomcat
$@ > /dev/null 2>&1Snippet for Skins Logic
Update the skins logic to use the general method for file overlay. Replace the existing skin synchronization block with the following:
# Synchronize skins
if [ -d ${METACATUI_CUSTOM_SKINS_PATH} ]; then
echo
echo '**********************************************************'
echo "Synchronizing skins from ${METACATUI_CUSTOM_SKINS_PATH}"
echo '***********************************************************'
echo
rsync -av ${METACATUI_CUSTOM_SKINS_PATH}/ ${METACAT_DIR}/style/skins/
fiThis snippet should replace the existing block from line 66 to line 111.