Giter Club home page Giter Club logo

fcrepo-docker's Introduction

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

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.

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.

fcrepo-docker's People

Contributors

andyundso avatar dbernstein avatar pwinckles avatar surfrdan avatar tomcbe avatar whikloj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fcrepo-docker's Issues

Accessing fcrepo from public IP gives error

Running fcrepo in docker, I can open the admin console on localhost: http://localhost:8001/fcrepo/rest/
When I access the same url on my external IP address: http://192.168.2.6:8001/fcrepo/rest/
I get an exception:
java.lang.IllegalArgumentException: Cannot translate NULL path at org.fcrepo.http.commons.api.rdf.HttpIdentifierConverter.toInternalId(HttpIdentifierConverter.java:91) at org.fcrepo.http.api.responses.StreamingBaseHtmlProvider.getResourceFromSubject(StreamingBaseHtmlProvider.java:227) at org.fcrepo.http.api.responses.StreamingBaseHtmlProvider.writeTo(StreamingBaseHtmlProvider.java:205) at org.fcrepo.http.api.responses.StreamingBaseHtmlProvider.writeTo(StreamingBaseHtmlProvider.java:92) at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo(WriterInterceptorExecutor.java:242) at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:227) at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:139) at org.glassfish.jersey.server.internal.JsonWithPaddingInterceptor.aroundWriteTo(JsonWithPaddingInterceptor.java:85) at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:139) at org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo(MappableExceptionWrapperInterceptor.java:61) at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:139) at org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1115) at org.glassfish.jersey.server.ServerRuntime$Responder.writeResponse(ServerRuntime.java:638) at org.glassfish.jersey.server.ServerRuntime$Responder.processResponse(ServerRuntime.java:371) at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:361) at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:256) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244) at org.glassfish.jersey.internal.Errors.process(Errors.java:292) at org.glassfish.jersey.internal.Errors.process(Errors.java:274) at org.glassfish.jersey.internal.Errors.process(Errors.java:244) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:232) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:680) at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:392) at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:365) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:318) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61) at org.fcrepo.auth.webac.WebACFilter.doFilterInternal(WebACFilter.java:244) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)

Error when running docker-compose up

Hi , i have encounter a problem when i run docker-compose up ,i am stuck at step 13/15
it seems like some of file is missing .

Step 13/15 : RUN cd /tmp && curl -fSL https://github.com/fcrepo4/fcrepo4/releases/download/fcrepo-$FEDORA_TAG/fcrepo-webapp-$FEDORA_TAG.war -o fcrepo.war && cp fcrepo.war /usr/local/tomcat/webapps/fcrepo.war
---> Running in ec07a8db8149
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
curl: (22) The requested URL returned error: 404 Not Found
ERROR: Service 'fcrepo' failed to build: The command '/bin/sh -c cd /tmp && curl -fSL https://github.com/fcrepo4/fcrepo4/releases/download/fcrepo-$FEDORA_TAG/fcrepo-webapp-$FEDORA_TAG.war -o fcrepo.war && cp fcrepo.war /usr/local/tomcat/webapps/fcrepo.war' returned a non-zero code: 22

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.