Skip to content

fcrepo-exts/fcrepo-docker

Repository files navigation

The Official Fedora Repository Docker Files

How to use

docker run -p8080:8080 --name=fcrepo fcrepo/fcrepo

The default configuration provides the following tomcat users:

Username Role Default password Description
fedoraAdmin fedoraAdmin fedoraAdmin Has full privileges on fedora

Fedora is deployed to the fcrepo context of Tomcat. i.e.

> curl -ufedoraAdmin:fedoraAdmin http://localhost:8080/fcrepo/rest/

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix fedora: <http://fedora.info/definitions/v4/repository#> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .

<http://localhost:8080/fcrepo/rest/>
        fedora:created                 "2023-12-12T14:06:11.200967Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
        fedora:lastModified            "2023-12-12T14:06:11.200967Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
        rdf:type                       ldp:BasicContainer ;
        rdf:type                       ldp:Resource ;
        rdf:type                       fedora:Resource ;
        rdf:type                       fedora:RepositoryRoot ;
        rdf:type                       ldp:RDFSource ;
        rdf:type                       ldp:Container ;
        rdf:type                       fedora:Container ;
        fedora:hasTransactionProvider  <http://localhost:8080/fcrepo/rest/fcr:tx> .

If you need additional users or don't want to provide the password for fedoraAdmin via a environment variable, you can specify your own tomcat-users.xml file with the environment variable TOMCAT_USERS_FILE, e.g:

docker run -p8080:8080 -v/path/on/host/tomcat-users.xml:/tomcat-users.xml -e TOMCAT_USERS_FILE=/tomcat-users.xml --name=fcrepo fcrepo/fcrepo

By default the docker container writes all data to /usr/local/tomcat/fcrepo-home. For persistent storage, this path should be declared as a volume, e.g:

docker run -p8080:8080 -v/path/on/host:/usr/local/tomcat/fcrepo-home --name=fcrepo fcrepo/fcrepo

Passing in configuration

Custom configuration can be passed into the docker container by using the following environment variables:

Variable Default Value Description
CATALINA_OPTS none
TOMCAT_USERS_FILE $CATALINA_HOME/conf/tomcat-users.xml Specify a custom tomcat-users.xml file with e.g. additional users
FEDORA_ADMIN_USERNAME fedoraAdmin If using the default tomcat-users.xml file: specify a custom username for the user fedoraAdmin
FEDORA_ADMIN_PASSWORD fedoraAdmin If using the default tomcat-users.xml file: specify a custom password for the FEDORA_ADMIN_USERNAME defined above
LOGBACK_CONFIGURATIONFILE none Specify a custom logback.configurationFile
ENCODED_SOLIDUS_HANDLING reject Sets the Tomcat encodedSolidusHandling property which defines how URLs with %2F are handled, valid values are reject, decode or passthrough.

Use the CATALINA_OPTS environment variable to pass in Java options (-Dname=value). You may also pass all your options via a properties file using the "fcrepo.config.file" option. For example:

docker run -p8080:8080 -v/path/on/local/machine/to/properties:/fcrepo.properties -e CATALINA_OPTS="-Dfcrepo.config.file=/fcrepo.properties" --name=fcrepo fcrepo/fcrepo

If you want direct access to fcrepo.home directory (without having to ssh into the container) you can do something like this:

echo "fcrepo.home=/fedora_home" > /path/to/fcrepo.properties
mkdir -p /path/to/fedora_home
docker run -p8080:8080 -v/path/to/fedora_home:/fedora_home -v/path/to/fcrepo.properties:/fcrepo.properties -e CATALINA_OPTS="-Dfcrepo.config.file=/fcrepo.properties" --name=fcrepo fcrepo/fcrepo

Now you should be able to list the contents of our container's fcrepo.home directory from the local file system like so:

ls -last /path/to/fedora_home

For a detailed explanation of the configuration options have a look at Application Configuration in the Lyrasis Wiki.

Official Dockerhub Releases and Tags

This repository also houses the GitHub actions and shell scripts which are responsible for updating the Official fcrepo DockerHub repository. There you will find tagged releases for your convenience following the common standard of:

  • fcrepo/fcrepo:latest : [DEPRECATED] We are phasing out the use of the latest tag. Please use a specifiv version number from the following available options.
  • fcrepo/fcrepo:MAJOR-tomcat9 : points to the most recent version of the MAJOR release and is paired with tomcat9 e.g. 'fcrepo/fcrepo:6-tomcat9'. Use this to target a major version but with a risk of changes though they should remain backwards compatible with previous versions.
  • fcrepo/fcrepo:MAJOR.MINOR-tomcat9 : points to the most recent version of the MAJOR and MINOR release and is paired with tomcat9 e.g. 'fcrepo/fcrepo:6.5-tomcat9'. Use this to target a known good marjor and minor version but with the latest bug fixes and no unexpected changes.
  • fcrepo/fcrepo:MAJOR.MINOR.PATCH-tomcat9 : points to the most recent version of the MAJOR and MINOR and PATCH release and is paired with tomcat9 e.g. 'fcrepo/fcrepo:6.4.1-tomcat9'. Use this to target a very specific patch release which you know to be right for your use case.
  • fcrfepo/fcrepo:MAJOR.MINOR.PATCH-SNAPSHOT : tracks the main branch of the repository and contains bleeding edge, as-yet unreleased changes. Use at your own risk! This is not designerd to be used in production. It is a convenient method of packaging and deploying the latest code for developers and testers. e.g. 6.5.0-SNAPSHOT

For more information on the Semantic Versioning scheme used by all of our repositories, refer to their documentation.

Development

Repository organization

This repository is used to manage docker images for the Fedora Commons from Version 5.x onwards. The Dockerfile for the latest release of each major version is managed on a separate branch.

  • 5.x-maintenance: latest release of version 5 (coming soon)
  • main: latest development snapshot

Building the docker image locally

To build the docker image from a locally built snapshot of fcrepo-webapp, pass the path to the fcrepo-webapp-*.war to the build script:

./build.sh /path/to/fcrepo-webapp-<version>.war

This will create a docker image fcrepo/fcrepo in your local docker repository.

About

The Official Fedora Repository Docker Build Scripts

Resources

Stars

Watchers

Forks

Packages

No packages published