From 3437b8aa3c151196d20e9651830b677da881940b Mon Sep 17 00:00:00 2001 From: Stian Soiland-Reyes Date: Tue, 7 Apr 2015 12:54:18 +0100 Subject: [PATCH 1/5] JENA-909: Docker image for Fuseki 2 Squashed commit of the following: commit f7959eb2b9f85a8782088debe53171ba5b7b8f21 Author: Stian Soiland-Reyes Date: Tue Apr 7 12:44:59 2015 +0100 make databases/ folder if not present commit 89f8ed7028b0d09cdc88eee50fab178c12a80ca7 Author: Stian Soiland-Reyes Date: Thu Apr 2 11:00:31 2015 +0100 pom.xml comments commit ffffc373ed76e04df3cec3592315b8beecc2ffb5 Author: Stian Soiland-Reyes Date: Thu Apr 2 10:50:10 2015 +0100 JENA-909: Conditionally mvn build - or use host's /target commit 2a68d52c56e9e03f303debf89b94b196baaaff57 Author: Stian Soiland-Reyes Date: Thu Apr 2 10:22:50 2015 +0100 JENA-909: Include jena-fuseki-docker in Maven build .. it won't actually build the Docker image, but it ensures the pom.xml here will have the correct fuseki version number for any updates. (unless we add a plugin like https://github.com/rhuss/docker-maven-plugin which needs Docker installed and running.) commit 0a1c11a5e9bf43a626fc9cc22d03409f4ae40848 Author: Stian Soiland-Reyes Date: Tue Mar 17 15:45:27 2015 +0000 Maven-based docker install commit 00c48a0901c0a6dd2d105a61dc7735f73955e01e Author: Stian Soiland-Reyes Date: Mon Feb 2 10:03:06 2015 +0000 Use apache-jena-fuseki distribution commit fdde1eae546429025ad559c6ed97fa77a866961f Author: Stian Soiland-Reyes Date: Wed Jan 28 12:41:53 2015 +0000 About changing ports, JENA-868 workaround. commit dcecd46d686c32c2bbe3100f020991911a641563 Author: Stian Soiland-Reyes Date: Wed Jan 28 12:03:00 2015 +0000 Apache headers commit 120989eb2a5f7fbec01c637f5aa32587ced4de6f Author: Stian Soiland-Reyes Date: Wed Jan 28 11:43:05 2015 +0000 Include JVM_ARGS as well commit a05cc0da409ec6bd92e590451b95f18d51bba310 Author: Stian Soiland-Reyes Date: Wed Jan 28 11:42:09 2015 +0000 About JVM_ARGS commit d6dd0f476a6f2f5b69508255040d8bcd76243f17 Author: Stian Soiland-Reyes Date: Tue Jan 27 16:23:34 2015 +0000 README correct paths within assembler file commit 7a0a6099e175a8e7654cad29764d29fad653b3f6 Author: Stian Soiland-Reyes Date: Tue Jan 27 16:20:20 2015 +0000 Remember to stop fuseki first! commit 3e914d21e2e645e9035c9af02fae440a77e7c1c9 Author: Stian Soiland-Reyes Date: Tue Jan 27 16:16:55 2015 +0000 More README commit 7bd57b481815c954181f1470f7dd9181aab0fcf7 Author: Stian Soiland-Reyes Date: Tue Jan 27 16:15:48 2015 +0000 README tweakery commit 471d9c20e981c22b56aa67a21c0528583ddfa19c Author: Stian Soiland-Reyes Date: Tue Jan 27 15:36:01 2015 +0000 README: tdbloader details moved further down commit 4a462d47fcf71c044b7db0f97fd0ba41aa48292a Author: Stian Soiland-Reyes Date: Tue Jan 27 14:52:16 2015 +0000 databases/ commit 6e9609dd803915aa4a5f9f4d5535b5ccb70ef74f Author: Stian Soiland-Reyes Date: Tue Jan 27 14:38:51 2015 +0000 simplify help - only if no arguments commit 252cdb1f85f2049dc542d00bc1bae6150f11f241 Author: Stian Soiland-Reyes Date: Tue Jan 27 14:35:42 2015 +0000 Corrected path to ./tdbloader commit 31cfd44948df62d5ff12b217178d1ba144b409ae Author: Stian Soiland-Reyes Date: Tue Jan 27 14:17:47 2015 +0000 tdbloader should not have --loc commit 379221ce27ec190f5ce9deb4001639dd5a0f31e7 Author: Stian Soiland-Reyes Date: Tue Jan 27 14:17:05 2015 +0000 Include tdbloader script commit 77ff337d9fadd61cdb85c5c0846edb7d5eb6f75b Author: Stian Soiland-Reyes Date: Tue Jan 27 14:16:49 2015 +0000 documentation commit 0c99ef91261c524422e49a99286460bba7456c11 Author: Stian Soiland-Reyes Date: Tue Jan 27 13:48:32 2015 +0000 loader script commit c2c512861948beb982d066e887f71422eae4f210 Author: Stian Soiland-Reyes Date: Mon Jan 26 16:37:57 2015 +0000 Updated README commit 2b1d0e55b10748db6b2bb28e1e1b2f855f67c9b0 Author: Stian Soiland-Reyes Date: Mon Jan 26 16:16:33 2015 +0000 Link to docker registry commit 64615f8dfba21eeabb32ec653ff95a6b8d9ca6b6 Author: Stian Soiland-Reyes Date: Mon Jan 26 16:08:50 2015 +0000 include pwgen. entrypint sorted. commit 8941d0a0b9da2425b1d3bb1db083df0b7fd885ea Author: Stian Soiland-Reyes Date: Mon Jan 26 16:02:03 2015 +0000 clear /var/lib/apt* commit 0abec64f48da8b93543e440a6b5fbb894089c632 Author: Stian Soiland-Reyes Date: Mon Jan 26 16:01:55 2015 +0000 Docker README commit c71ab5bb1dae4b580fe0c6a083e147a2b75c1cdb Author: Stian Soiland-Reyes Date: Mon Jan 26 15:41:47 2015 +0000 Docker image for fuseki2 sets a random password if $ADMIN_PASSWORD is not set commit e4d7fd9718b1a2f246f026fb860bc3bc5929c0f0 Author: Stian Soiland-Reyes Date: Sun Jan 18 23:28:26 2015 +0000 Dockerfile for fuseki2 --- jena-fuseki2/jena-fuseki-docker/Dockerfile | 62 ++++++ jena-fuseki2/jena-fuseki-docker/README.md | 195 ++++++++++++++++++ .../jena-fuseki-docker/docker-entrypoint.sh | 40 ++++ jena-fuseki2/jena-fuseki-docker/load.sh | 75 +++++++ jena-fuseki2/jena-fuseki-docker/pom.xml | 81 ++++++++ jena-fuseki2/jena-fuseki-docker/shiro.ini | 52 +++++ jena-fuseki2/jena-fuseki-docker/tdbloader | 17 ++ jena-fuseki2/pom.xml | 1 + 8 files changed, 523 insertions(+) create mode 100644 jena-fuseki2/jena-fuseki-docker/Dockerfile create mode 100644 jena-fuseki2/jena-fuseki-docker/README.md create mode 100644 jena-fuseki2/jena-fuseki-docker/docker-entrypoint.sh create mode 100644 jena-fuseki2/jena-fuseki-docker/load.sh create mode 100644 jena-fuseki2/jena-fuseki-docker/pom.xml create mode 100644 jena-fuseki2/jena-fuseki-docker/shiro.ini create mode 100644 jena-fuseki2/jena-fuseki-docker/tdbloader diff --git a/jena-fuseki2/jena-fuseki-docker/Dockerfile b/jena-fuseki2/jena-fuseki-docker/Dockerfile new file mode 100644 index 00000000000..1c833f2e326 --- /dev/null +++ b/jena-fuseki2/jena-fuseki-docker/Dockerfile @@ -0,0 +1,62 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM maven:3.3-jdk-7 + +# Config and data +VOLUME /fuseki +ENV FUSEKI_BASE /fuseki + +# Installation folder +ENV FUSEKI_HOME /jena-fuseki + +ENV DEPS pwgen +RUN export DEBIAN_FRONTEND=noninteractive && \ + rm -rf /var/lib/apt/lists/* && \ + apt-get update && \ + apt-get install -y $DEPS && \ + apt-get autoremove -y && \ + apt-get autoclean && \ + rm -rf /var/lib/apt/lists/* && \ + rm -rf /tmp/* + + +WORKDIR /tmp +COPY . /tmp/ +# Use target/ from host as-is, or build inside if missing +RUN if [ ! -d target/dist ] ; then mvn install ; fi && \ + mv target/dist/* $FUSEKI_HOME && rm -rf /tmp/* + + +# As "localhost" is often inaccessible within Docker container, +# we'll enable basic-auth with a random admin password +# (which we'll generate on start-up) +COPY shiro.ini /jena-fuseki/shiro.ini +COPY docker-entrypoint.sh / +RUN chmod 755 /docker-entrypoint.sh +ENTRYPOINT ["/docker-entrypoint.sh"] + +# Loader scripts +COPY load.sh /jena-fuseki/ +COPY tdbloader /jena-fuseki/ +RUN chmod 755 /jena-fuseki/load.sh /jena-fuseki/tdbloader +#VOLUME /staging + + +# Where we start our server from +WORKDIR /jena-fuseki +EXPOSE 3030 +CMD ["/jena-fuseki/fuseki-server"] + diff --git a/jena-fuseki2/jena-fuseki-docker/README.md b/jena-fuseki2/jena-fuseki-docker/README.md new file mode 100644 index 00000000000..cfb1c247e84 --- /dev/null +++ b/jena-fuseki2/jena-fuseki-docker/README.md @@ -0,0 +1,195 @@ +# Apache Jena Fuseki 2 docker image + +**Docker image:** [stain/jena-fuseki](https://registry.hub.docker.com/u/stain/jena-fuseki/) + +This is a [Docker](http://docker.io/) image for running +[Apache Jena Fuseki](http://jena.apache.org/documentation/serving_data/) 2, +which is a [SPARQL 1.1](http://www.w3.org/TR/sparql11-overview/) server with a +web interface, backed by the +[Apache Jena TDB](http://jena.apache.org/documentation/tdb/) RDF triple store. + +Feel free to contact the [jena users +list](http://jena.apache.org/help_and_support/) for any questions on using +Jena or Fuseki. + + +## Use + +To try out this image, try: + + docker run -p 3030:3030 -it stain/jena-fuseki + +The Apache Jena Fuseki should then be available at http://localhost:3030/ + +To expose Fuseki on a different port, modify `-p` and run `./fuseki-server --port=PORT` (see [JENA-868](https://issues.apache.org/jira/browse/JENA-868)): + + docker run -p 8080:8080 -it stain/jena-fuseki ./fuseki-server --port=8080 + + +To load RDF graphs, you will need to log in as the `admin` user. To see the +automatically generated admin password, see the output from above, or +use `docker logs` with the name of your container. + +Note that the password is only generated on the first run, e.g. when the +volume `/fuseki` is an empty directory. + +You can override the admin-password using the form +`-e ADMIN_PASSWORD=pw123`: + + docker run -p 3030:3030 -e ADMIN_PASSWORD=pw123 -it stain/jena-fuseki + +To specify Java settings such as the amount of memory to allocate for the +heap (default: 1200 MiB), set the `JVM_ARGS` environment with `-e`: + + docker run -p 3030:3030 -e JVM_ARGS=-Xmx2g -it stain/jena-fuseki + + +## Data persistence + +Fuseki's data is stored in the Docker volume `/fuseki` within the container. +Note that unless you use `docker restart` or one of the mechanisms below, data +is lost between each run of the jena-fuseki image. + +To store the data in a named Docker volume container `fuseki-data` +(recommended), create it first as: + + docker run --name fuseki-data -v /fuseki busybox + +Then start fuseki using `--volumes-from`. This allows you to later upgrade the +jena-fuseki docker image without losing the data. The command below also uses +`-d` to start the container in the background. + + docker run -d --name fuseki -p 3030:3030 --volumes-from fuseki-data stain/jena-fuseki + +If you want to store fuseki data in a specified location on the host (e.g. for +disk space or speed requirements), specify it using `-v`: + + docker run -d --name fuseki -p 3030:3030 -v /ssd/data/fuseki:/fuseki -it stain/jena-fuseki + +Note that the `/fuseki` volume must only be accessed from a single Fuseki +container at a time. + +To check the logs for the container you gave `--name fuseki`, use: + + docker logs fuseki + +To stop the named container, use: + + docker stop fuseki + +.. or press Ctrl-C if you started the container with `-it`. + +To restart a named container (it will remember the volume and port config) + + docker restart fuseki + +## Upgrading Fuseki + +If you want to upgrade the Fuseki container named `fuseki` which use the data +volume `fuseki-data` as recommended above, do: + + docker pull stain/jena-fuseki + docker stop fuseki + docker rm fuseki + docker run -d --name fuseki -p 3030:3030 --volumes-from fuseki-data stain/jena-fuseki + + +## Data loading + +Fuseki allows uploading of RDF datasets through the web interface and web +services, but for large datasets it is more efficient to load them directly +using the command line. + +This docker image includes a shell script `load.sh` that invokes the +[tdbloader](https://jena.apache.org/documentation/tdb/commands.html) +command line tool and load datasets from the docker volume `/staging`. + + +For help, try: + + docker run stain/jena-fuseki ./load.sh + +You will most likely want to load from a folder on the host computer by using +`-v`, and into a data volume that you can then use with the regular fuseki. + +Before data loading, you must either stop the Fuseki container, or +load the data into a brand new dataset that Fuseki doesn't know about yet. +To stop the docker container you named `fuseki`: + + docker stop fuseki + +The example below assume you want to populate the Fuseki dataset 'chembl19' +from the Docker data volume `fuseki-data` (see above) by loading the two files +`cco.ttl.gz` and `void.ttl.gz` from `/home/stain/ops/chembl19` on the host +computer: + + docker run --volumes-from fuseki-data -v /home/stain/ops/chembl19:/staging \ + stain/jena-fuseki ./load.sh chembl19 cco.ttl.gz void.ttl.gz + +**Tip:** You might find it benefitial to run data loading from the data staging +directory in order to use tab-completion etc. without exposing the path on the +host. The `./load.sh` will expand patterns like `*.ttl` - you might have to +use single quotes (e.g. `'*.ttl'`) on the host to avoid them being expanded +locally. + +If you don't specify any filenames to `load.sh`, all filenames directly under +`/staging` that match these GLOB patterns will be loaded: + + *.rdf *.rdf.gz *.ttl *.ttl.gz *.owl *.owl.gz *.nt *.nt.gz *.nquads *.nquads.gz + +`load.sh` populates the default graph. To populate named +graphs, see the `tdbloader` section below. + +**NOTE**: If you load data into a brand new `/fuseki` volume, a new random +admin password will be set before you have started Fuseki. +You can either check the output of the data loading, or later override the +password using `-e ADMIN_PASSWORD=pw123`. + + +## Recognizing the dataset in Fuseki + +If you loaded into an existing dataset, Fuseki should find the data after +(re)starting with the same data volume (see [Data +persistence](#Data_persistence) above): + + docker restart fuseki + +If you created a brand new dataset, then in Fuseki go to *Manage datasets*, +click **Add new dataset**, tick **Persistent** and provide the database name +exactly as provided to `load.sh`, e.g. `chembl19`. + +Now go to *Dataset*, select from the dropdown menu, and try out *Info* and *Query*. + +**Tip**: It is possible to load a new dataset into the volume of a +running Fuseki server, as long as you don't "create" it in Fuseki before +`load.sh` has finished. + + +## Loading with tdbloader + +If you have more advanced requirements, like loading multiple datasets or named graphs, you can +use [tdbloader](https://jena.apache.org/documentation/tdb/commands.html) directly together with +a [TDB assembler file](https://jena.apache.org/documentation/tdb/assembler.html). + +Note that Fuseki TDB datasets are sub-folders in `/fuseki/databases/`. + +You will need to provide the assembler file on a mounted Docker volume together with the +data: + + docker run --volumes-from fuseki-data -v /home/stain/data:/staging stain/jena-fuseki \ + ./tdbloader --desc=/staging/tdb.ttl + +Remember to use the Docker container's data volume paths within the assembler +file, e.g. `/staging/dataset.ttl` instead of `/home/stain/data/dataset.ttl`. + + +## Customizing Fuseki configuration + +If you need to modify Fuseki's configuration further, you can use the equivalent of: + + docker run --volumes-from fuseki-data -it ubuntu bash + +and inspect `/fuseki` with the shell. Remember to restart fuseki afterwards: + + docker restart fuseki + diff --git a/jena-fuseki2/jena-fuseki-docker/docker-entrypoint.sh b/jena-fuseki2/jena-fuseki-docker/docker-entrypoint.sh new file mode 100644 index 00000000000..3b03a21c520 --- /dev/null +++ b/jena-fuseki2/jena-fuseki-docker/docker-entrypoint.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e + +if [ ! -f "$FUSEKI_BASE/shiro.ini" ] ; then + # First time + echo "###################################" + echo "Initializing Apache Jena Fuseki" + echo "" + cp "$FUSEKI_HOME/shiro.ini" "$FUSEKI_BASE/shiro.ini" + if [ -z "$ADMIN_PASSWORD" ] ; then + ADMIN_PASSWORD=$(pwgen -s 15) + echo "Randomly generated admin password:" + echo "" + echo "admin=$ADMIN_PASSWORD" + fi + echo "" + echo "###################################" +fi + +# $ADMIN_PASSWORD can always override +if [ -n "$ADMIN_PASSWORD" ] ; then + sed -i "s/^admin=.*/admin=$ADMIN_PASSWORD/" "$FUSEKI_BASE/shiro.ini" +fi + +exec "$@" diff --git a/jena-fuseki2/jena-fuseki-docker/load.sh b/jena-fuseki2/jena-fuseki-docker/load.sh new file mode 100644 index 00000000000..e9a510dab96 --- /dev/null +++ b/jena-fuseki2/jena-fuseki-docker/load.sh @@ -0,0 +1,75 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +extensions="rdf ttl owl nt nquads" +PATTERNS="" +for e in $extensions ; do + PATTERNS="$PATTERNS *.$e *.$e.gz" +done + +if [ $# -eq 0 ] ; then + echo "$0 [DB] [PATTERN ...]" + echo "Load one or more RDF files into Jena Fuseki TDB database DB." + echo "" + echo "Current directory is assumed to be /staging" + echo "" + echo 'PATTERNs can be a filename or a shell glob pattern like *ttl' + echo "" + echo "If no PATTERN are given, the default patterns are searched:" + echo "$PATTERNS" + exit 0 +fi + +cd /staging 2>/dev/null || echo "/staging not found" >&2 +echo "Current directory:" $(pwd) + +DB=$1 +shift + +if [ $# -eq 0 ] ; then + patterns="$PATTERNS" +else + patterns="$@" +fi + +files="" +for f in $patterns; do + if [ -f $f ] ; then + files="$files $f" + else + if [ $# -gt 0 ] ; then + # User-specified file/pattern missing + echo "WARNING: Not found: $f" >&2 + fi + fi +done + +if [ "$files" == "" ] ; then + echo "No files found for: " >&2 + echo "$patterns" >&2 + exit 1 +fi + +mkdir -p $FUSEKI_BASE/databases/ + +echo "#########" +echo "Loading to Fuseki TDB database $DB:" +echo "" +echo $files +echo "#########" + + +exec $FUSEKI_HOME/tdbloader --loc=$FUSEKI_BASE/databases/$DB $files diff --git a/jena-fuseki2/jena-fuseki-docker/pom.xml b/jena-fuseki2/jena-fuseki-docker/pom.xml new file mode 100644 index 00000000000..fde32be7269 --- /dev/null +++ b/jena-fuseki2/jena-fuseki-docker/pom.xml @@ -0,0 +1,81 @@ + + + + + 4.0.0 + + Apache Jena - Fuseki Binary Distribution + jena-fuseki-docker + pom + + + org.apache.jena + jena-fuseki + 2.0.1-SNAPSHOT + ../ + + + Fuseki Docker image + This pom file does not actually build the docker image, but + is used to unpack the the apache-jena-fuseki distribution. + + + + + + + + maven-dependency-plugin + + + unpack + package + + unpack + + + + + org.apache.jena + apache-jena-fuseki + ${project.version} + tar.gz + ${project.build.directory}/dist + + + + + + + + + + + + + + apache.snapshots + Apache Snapshot Repository + http://repository.apache.org/snapshots + + false + + + + + diff --git a/jena-fuseki2/jena-fuseki-docker/shiro.ini b/jena-fuseki2/jena-fuseki-docker/shiro.ini new file mode 100644 index 00000000000..e0b57c0cca2 --- /dev/null +++ b/jena-fuseki2/jena-fuseki-docker/shiro.ini @@ -0,0 +1,52 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +[main] +# Development +ssl.enabled = false + +plainMatcher=org.apache.shiro.authc.credential.SimpleCredentialsMatcher +#iniRealm=org.apache.shiro.realm.text.IniRealm +iniRealm.credentialsMatcher = $plainMatcher + +#localhost=org.apache.jena.fuseki.authz.LocalhostFilter + +[users] +# Implicitly adds "iniRealm = org.apache.shiro.realm.text.IniRealm" +admin=pw + +[roles] + +[urls] +## Control functions open to anyone +/$/status = anon +/$/ping = anon + +## and the rest are restricted +/$/** = authcBasic,user[admin] + + +## If you want simple, basic authentication user/password +## on the operations, +## 1 - set a password in [users] +## 2 - change the line above to: +## /$/** = authcBasic,user[admin] +## and set a better + +## or to allow any access. +##/$/** = anon + +# Everything else +/**=anon diff --git a/jena-fuseki2/jena-fuseki-docker/tdbloader b/jena-fuseki2/jena-fuseki-docker/tdbloader new file mode 100644 index 00000000000..fa549da8959 --- /dev/null +++ b/jena-fuseki2/jena-fuseki-docker/tdbloader @@ -0,0 +1,17 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +JVM_ARGS=${JVM_ARGS:--Xmx1200M} +exec java $JVM_ARGS -cp $FUSEKI_HOME/fuseki-server.jar tdb.tdbloader $@ diff --git a/jena-fuseki2/pom.xml b/jena-fuseki2/pom.xml index 2bfa165b073..ce7dd61b070 100644 --- a/jena-fuseki2/pom.xml +++ b/jena-fuseki2/pom.xml @@ -72,6 +72,7 @@ jena-fuseki-core jena-fuseki-war jena-fuseki-server + jena-fuseki-docker apache-jena-fuseki From 26e1fdc8860f2eedd120dab3f864f7cfbe28f67a Mon Sep 17 00:00:00 2001 From: Stian Soiland-Reyes Date: Tue, 7 Apr 2015 14:18:39 +0100 Subject: [PATCH 2/5] JENA-909: Save 100 MB by clearing /root/.m2/repository --- jena-fuseki2/jena-fuseki-docker/Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jena-fuseki2/jena-fuseki-docker/Dockerfile b/jena-fuseki2/jena-fuseki-docker/Dockerfile index 1c833f2e326..4d01dc6f9db 100644 --- a/jena-fuseki2/jena-fuseki-docker/Dockerfile +++ b/jena-fuseki2/jena-fuseki-docker/Dockerfile @@ -29,15 +29,14 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get install -y $DEPS && \ apt-get autoremove -y && \ apt-get autoclean && \ - rm -rf /var/lib/apt/lists/* && \ - rm -rf /tmp/* + rm -rf /var/lib/apt/lists/* /tmp/* WORKDIR /tmp COPY . /tmp/ # Use target/ from host as-is, or build inside if missing RUN if [ ! -d target/dist ] ; then mvn install ; fi && \ - mv target/dist/* $FUSEKI_HOME && rm -rf /tmp/* + mv target/dist/* $FUSEKI_HOME && rm -rf /tmp/* /root/.m2 # As "localhost" is often inaccessible within Docker container, From e6ea8dab8b73d4ee643a2d880d9acf3eb84d566c Mon Sep 17 00:00:00 2001 From: Stian Soiland-Reyes Date: Thu, 10 Sep 2015 23:01:05 +0100 Subject: [PATCH 3/5] Use Java 8 for Fuseki docker image --- jena-fuseki2/jena-fuseki-docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jena-fuseki2/jena-fuseki-docker/Dockerfile b/jena-fuseki2/jena-fuseki-docker/Dockerfile index 4d01dc6f9db..e2d40793cc7 100644 --- a/jena-fuseki2/jena-fuseki-docker/Dockerfile +++ b/jena-fuseki2/jena-fuseki-docker/Dockerfile @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM maven:3.3-jdk-7 +FROM maven:3.3-jdk-8 # Config and data VOLUME /fuseki From fc159f17918e48dd170f359d3e3f6ea72f541040 Mon Sep 17 00:00:00 2001 From: Stian Soiland-Reyes Date: Thu, 10 Sep 2015 23:01:27 +0100 Subject: [PATCH 4/5] Corrected version --- jena-fuseki2/jena-fuseki-docker/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jena-fuseki2/jena-fuseki-docker/pom.xml b/jena-fuseki2/jena-fuseki-docker/pom.xml index fde32be7269..0e5ac00be56 100644 --- a/jena-fuseki2/jena-fuseki-docker/pom.xml +++ b/jena-fuseki2/jena-fuseki-docker/pom.xml @@ -26,13 +26,13 @@ org.apache.jena jena-fuseki - 2.0.1-SNAPSHOT + 2.3.1-SNAPSHOT ../ Fuseki Docker image This pom file does not actually build the docker image, but - is used to unpack the the apache-jena-fuseki distribution. + is used to unpack the apache-jena-fuseki distribution. From 6b73269f1a7d5f77bcbb7fa63df4d584abba0f8b Mon Sep 17 00:00:00 2001 From: Stian Soiland-Reyes Date: Thu, 10 Sep 2015 23:15:08 +0100 Subject: [PATCH 5/5] README update --- jena-fuseki2/jena-fuseki-docker/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/jena-fuseki2/jena-fuseki-docker/README.md b/jena-fuseki2/jena-fuseki-docker/README.md index cfb1c247e84..b1bd96a2152 100644 --- a/jena-fuseki2/jena-fuseki-docker/README.md +++ b/jena-fuseki2/jena-fuseki-docker/README.md @@ -1,9 +1,11 @@ # Apache Jena Fuseki 2 docker image -**Docker image:** [stain/jena-fuseki](https://registry.hub.docker.com/u/stain/jena-fuseki/) +**Docker image:** [stain/jena-fuseki](https://hub.docker.com/r/stain/jena-fuseki/) -This is a [Docker](http://docker.io/) image for running -[Apache Jena Fuseki](http://jena.apache.org/documentation/serving_data/) 2, +(*TODO*: Register as official image on Docker Hub) + +This is a [Docker](https://www.docker.com/) image for running +[Apache Jena Fuseki](http://jena.apache.org/documentation/fuseki2/) 2, which is a [SPARQL 1.1](http://www.w3.org/TR/sparql11-overview/) server with a web interface, backed by the [Apache Jena TDB](http://jena.apache.org/documentation/tdb/) RDF triple store.