Skip to content

Refactor Metacat Docker Image to Allow Overlay of Arbitrary Files #40

@vchendrix

Description

@vchendrix

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.sh script to include logic that rsyncs any files placed in /tmp/files (with relative paths) to /usr/local/tomcat/webapps/$METACAT_APP_CONTEXT after 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/
fi

This snippet should be placed before the line that starts Tomcat:

# Insert here before Tomcat start
# Start tomcat
$@ > /dev/null 2>&1

Snippet 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/
fi

This snippet should replace the existing block from line 66 to line 111.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions