-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f22cf0e
commit 0b36bfc
Showing
9 changed files
with
1,507 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
FROM ubuntu:14.04 | ||
|
||
MAINTAINER Yinlin Chen "[email protected]" | ||
|
||
ARG FedoraConfig= | ||
ARG ModeshapeConfig=minimal-default | ||
|
||
# Install essential packages | ||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
curl \ | ||
maven \ | ||
openssh-server \ | ||
software-properties-common \ | ||
vim \ | ||
wget \ | ||
htop tree zsh fish | ||
|
||
|
||
# Install Java 8 | ||
# Define commonly used JAVA_HOME variable | ||
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle | ||
|
||
RUN add-apt-repository -y ppa:webupd8team/java \ | ||
&& apt-get update -y \ | ||
&& echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections \ | ||
&& apt-get install -y oracle-java8-installer \ | ||
&& update-java-alternatives -s java-8-oracle \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& rm -rf /var/cache/oracle-jdk8-installer | ||
|
||
|
||
# Install Tomcat 7. | ||
ENV CATALINA_HOME /usr/local/tomcat7 | ||
ENV PATH $CATALINA_HOME/bin:$PATH | ||
ENV TOMCAT_MAJOR 7 | ||
ENV TOMCAT_VERSION 7.0.72 | ||
ENV TOMCAT_TGZ_URL http://archive.apache.org/dist/tomcat/tomcat-$TOMCAT_MAJOR/v$TOMCAT_VERSION/bin/apache-tomcat-$TOMCAT_VERSION.tar.gz | ||
|
||
RUN mkdir -p "$CATALINA_HOME" \ | ||
&& cd $CATALINA_HOME \ | ||
&& set -x \ | ||
&& curl -fSL "$TOMCAT_TGZ_URL" -o tomcat.tar.gz \ | ||
&& tar -xvf tomcat.tar.gz --strip-components=1 \ | ||
&& rm bin/*.bat \ | ||
&& rm tomcat.tar.gz* \ | ||
&& useradd -ms /bin/bash tomcat7 \ | ||
&& sed -i '$i<role rolename="fedoraUser"/>$i<role rolename="fedoraAdmin"/>$i<role rolename="manager-gui"/>$i<user username="testuser" password="password1" roles="fedoraUser"/>$i<user username="adminuser" password="password2" roles="fedoraUser"/>$i<user username="fedoraAdmin" password="secret3" roles="fedoraAdmin"/>$i<user username="fedora4" password="fedora4" roles="manager-gui"/>' /usr/local/tomcat7/conf/tomcat-users.xml | ||
|
||
|
||
RUN echo 'JAVA_OPTS="$JAVA_OPTS -Dfcrepo.modeshape.configuration=classpath:/config/'$ModeshapeConfig'/repository.json -Dfcrepo.home=/mnt/ingest -Dfcrepo.audit.container=/audit"' > $CATALINA_HOME/bin/setenv.sh \ | ||
&& chmod +x $CATALINA_HOME/bin/setenv.sh | ||
|
||
|
||
# Make the ingest directory | ||
RUN mkdir /mnt/ingest \ | ||
&& chown -R tomcat7:tomcat7 /mnt/ingest | ||
|
||
VOLUME /mnt/ingest | ||
|
||
|
||
# Install Fedora4 | ||
ENV FEDORA_VERSION 4.6.2 | ||
ENV FEDORA_TAG 4.6.2 | ||
|
||
RUN mkdir -p /var/lib/tomcat7/fcrepo4-data \ | ||
&& chown tomcat7:tomcat7 /var/lib/tomcat7/fcrepo4-data \ | ||
&& chmod g-w /var/lib/tomcat7/fcrepo4-data \ | ||
&& cd /tmp \ | ||
&& curl -fSL https://github.com/fcrepo4-exts/fcrepo-webapp-plus/releases/download/fcrepo-webapp-plus-$FEDORA_TAG/fcrepo-webapp-plus-$FedoraConfig$FEDORA_VERSION.war -o fcrepo.war \ | ||
&& cp fcrepo.war /usr/local/tomcat7/webapps/fcrepo.war \ | ||
&& chown tomcat7:tomcat7 /usr/local/tomcat7/webapps/fcrepo.war | ||
|
||
|
||
# Install Solr | ||
ENV SOLR_VERSION 4.10.3 | ||
ENV SOLR_HOME /usr/local/tomcat7/solr | ||
|
||
RUN cd /tmp \ | ||
&& curl -fSL http://archive.apache.org/dist/lucene/solr/$SOLR_VERSION/solr-$SOLR_VERSION.tgz -o solr-$SOLR_VERSION.tgz \ | ||
&& curl -fSL http://repo1.maven.org/maven2/commons-logging/commons-logging/1.1.2/commons-logging-1.1.2.jar -o commons-logging-1.1.2.jar \ | ||
&& mkdir -p "$SOLR_HOME" \ | ||
&& tar -xzf solr-"$SOLR_VERSION".tgz \ | ||
&& cp -v /tmp/solr-"$SOLR_VERSION"/dist/solr-"$SOLR_VERSION".war /usr/local/tomcat7/webapps/solr.war \ | ||
&& chown tomcat7:tomcat7 /usr/local/tomcat7/webapps/solr.war \ | ||
&& cp "commons-logging-1.1.2.jar" /usr/local/tomcat7/lib \ | ||
&& cp /tmp/solr-"$SOLR_VERSION"/example/lib/ext/slf4j* /usr/local/tomcat7/lib \ | ||
&& cp /tmp/solr-"$SOLR_VERSION"/example/lib/ext/log4j* /usr/local/tomcat7/lib \ | ||
&& chown -hR tomcat7:tomcat7 /usr/local/tomcat7/lib \ | ||
&& cp -Rv /tmp/solr-"$SOLR_VERSION"/example/solr/* $SOLR_HOME \ | ||
&& chown -hR tomcat7:tomcat7 $SOLR_HOME \ | ||
&& touch /var/lib/tomcat7/velocity.log \ | ||
&& chown tomcat7:tomcat7 /var/lib/tomcat7/velocity.log | ||
|
||
COPY config/schema.xml $SOLR_HOME/collection1/conf/ | ||
|
||
RUN chown -hR tomcat7:tomcat7 $SOLR_HOME | ||
|
||
# Install Fuseki | ||
ENV FUSEKI_VERSION 2.3.1 | ||
ENV FUSEKI_BASE /usr/local/fuseki | ||
ENV FUSEKI_DEPLOY /usr/local/tomcat7/webapps | ||
|
||
RUN cd && mkdir -p "$FUSEKI_BASE" \ | ||
&& mkdir -p "$FUSEKI_BASE"/configuration \ | ||
&& chown -hR tomcat7:tomcat7 $FUSEKI_BASE \ | ||
&& cd /tmp \ | ||
&& curl -fSL http://archive.apache.org/dist/jena/binaries/apache-jena-fuseki-$FUSEKI_VERSION.tar.gz -o apache-jena-fuseki-$FUSEKI_VERSION.tar.gz \ | ||
&& tar -xzvf apache-jena-fuseki-$FUSEKI_VERSION.tar.gz \ | ||
&& mv apache-jena-fuseki-"$FUSEKI_VERSION" jena-fuseki1-"$FUSEKI_VERSION" \ | ||
&& cd jena-fuseki1-"$FUSEKI_VERSION" \ | ||
&& mv -v fuseki.war $FUSEKI_DEPLOY \ | ||
&& chown -hR tomcat7:tomcat7 $FUSEKI_DEPLOY/fuseki.war | ||
|
||
COPY config/shiro.ini /root/ | ||
COPY config/test.ttl /root/ | ||
|
||
RUN cp /root/shiro.ini /usr/local/fuseki/. \ | ||
&& cp /root/test.ttl /usr/local/fuseki/configuration/. | ||
|
||
# Install Apache Karaf | ||
ENV KARAF_VERSION 4.0.5 | ||
|
||
COPY config/karaf_service.script /root/ | ||
|
||
RUN cd /tmp \ | ||
&& wget -q -O "apache-karaf-$KARAF_VERSION.tar.gz" "http://archive.apache.org/dist/karaf/"$KARAF_VERSION"/apache-karaf-"$KARAF_VERSION".tar.gz" \ | ||
&& tar -zxvf apache-karaf-$KARAF_VERSION.tar.gz \ | ||
&& mv /tmp/apache-karaf-$KARAF_VERSION /opt \ | ||
&& ln -s "/opt/apache-karaf-$KARAF_VERSION" /opt/karaf | ||
|
||
# Fedora Camel Toolbox | ||
COPY config/fedora_camel_toolbox.script /root/ | ||
COPY scripts/fedora_camel_toolbox.sh /root/ | ||
|
||
COPY scripts/runall.sh /root/ | ||
|
||
EXPOSE 8080 | ||
EXPOSE 9080 | ||
|
||
WORKDIR $CATALINA_HOME | ||
|
||
CMD sh /root/runall.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Fedora 4 Docker Repo | ||
|
||
This is the Git repo of the Docker image for [Fedora 4 docker](https://hub.docker.com/r/yinlinchen/fcrepo4-docker/). Please see the [Hub page](https://hub.docker.com/r/yinlinchen/fcrepo4-docker/) for the full readme on how to use the Docker image and for information regarding contributing and issues. | ||
|
||
## Requirements | ||
|
||
* [Docker](https://www.docker.com/) | ||
|
||
## Usage | ||
|
||
1. `docker pull yinlinchen/fcrepo4-docker` | ||
2. `docker run -it -p 8080:8080 -p 9080:9080 -d yinlinchen/fcrepo4-docker:4.6.2` | ||
3. Use `docker ps` to check the "CONTAINER ID" and "STATUS". The container should be ready to use after 5 minutes. | ||
|
||
You can shell into the machine with `docker exec -i -t "CONTAINER ID" /bin/bash` | ||
|
||
## In this Docker image | ||
|
||
* Ubuntu 14.04 64-bit machine with: | ||
* [Tomcat 7.0.72](https://tomcat.apache.org) at [http://localhost:8080](http://localhost:8080) | ||
* Manager username = "fedora4", password = "fedora4" | ||
* [Fedora 4.6.2](https://wiki.duraspace.org/display/FF/Downloads) at [http://localhost:8080/fcrepo](http://localhost:8080/fcrepo) | ||
* No authentication configured | ||
* [Solr 4.10.3](https://lucene.apache.org/solr/) at [http://localhost:8080/solr](http://localhost:8080/solr), for indexing & searching your content. | ||
* Installed in "/usr/local/tomcat7/solr" | ||
* [Apache Karaf 4.0.5](http://karaf.apache.org/) | ||
Installed in /opt/karaf | ||
Installed as a service apache-karaf | ||
* [Fuseki 2.3.1](https://jena.apache.org/documentation/serving_data/index.html) at [http://localhost:8080/fuseki](http://localhost:8080/fuseki), for querying and updating. | ||
* Installed in "/usr/local/fuseki" | ||
* Dataset Path name "/test" | ||
* Persistent storage "/usr/local/fuseki/databases/test_data" | ||
* [Fcrepo-camel-toolbox 4.6.0](https://github.com/fcrepo4-labs/fcrepo-camel-toolbox) | ||
* Installed in Tomcat container | ||
|
||
ps. MacOS: docker is configured to use the default machine with IP e.g. 192.168.99.100 or 127.0.0.1, the Fedora 4 URL is either [http://192.168.99.100:8080/fcrepo](http://192.168.99.100:8080/fcrepo) or [http://127.0.0.1/fcrepo](http://127.0.0.1/fcrepo). You can use "docker-machine ip" to see your docker machine IP. | ||
|
||
|
||
## Fedora Configuration | ||
The default Docker build is Fedora 4 without WebAC and Audit capability. | ||
``` | ||
docker build -t="4.6.2-default" . | ||
``` | ||
|
||
To enable Fedora 4 with WebAC enabled. | ||
``` | ||
docker build --build-arg FedoraConfig=webac- --build-arg ModeshapeConfig=servlet-auth -t="4.6.2-webac" . | ||
``` | ||
Three Fedora user accounts are available: | ||
* user account testuser, with password password1 | ||
* user account adminuser, with password password2 | ||
* admin account fedoraAdmin with the password secret3 | ||
|
||
To enable Fedora 4 with Audit capability. | ||
``` | ||
docker build --build-arg FedoraConfig=audit- -t="4.6.2-audit" . | ||
``` | ||
|
||
To enable Fedora 4 with WebAC and Audit capability. | ||
``` | ||
docker build --build-arg FedoraConfig=webac-audit- --build-arg ModeshapeConfig=servlet-auth -t="4.6.2-webac-audit" . | ||
``` | ||
|
||
|
||
## Maintainers | ||
|
||
Current maintainers: | ||
|
||
* [Yinlin Chen](https://github.com/yinlinchen) | ||
* [Paul Mather](https://github.com/pmather) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
feature:repo-add mvn:org.fcrepo.camel/toolbox-features/4.6.0/xml/features | ||
feature:install fcrepo-service-activemq | ||
feature:install fcrepo-fixity | ||
feature:install fcrepo-indexing-solr | ||
feature:install fcrepo-indexing-triplestore | ||
feature:install fcrepo-reindexing | ||
feature:install fcrepo-serialization | ||
feature:install fcrepo-audit-triplestore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
feature:install wrapper | ||
shell:sleep 1000 | ||
wrapper:install | ||
logout |
Oops, something went wrong.