You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@jena.apache.org by GitBox <gi...@apache.org> on 2020/09/04 16:08:58 UTC

[GitHub] [jena] afs commented on a change in pull request #786: JENA-1949: Docker tools for Fuseki

afs commented on a change in pull request #786:
URL: https://github.com/apache/jena/pull/786#discussion_r483717643



##########
File path: jena-fuseki2/jena-fuseki-docker/README.md
##########
@@ -0,0 +1,96 @@
+# Apache Jena Fuseki Docker Tools
+
+This package contains a Dockerfile, docker-compose file, and helper scripts to
+create a docker container for Apache Jena Fuseki.
+
+The docker container is based on 
+[Fuseki main](https://jena.apache.org/documentation/fuseki2/fuseki-main)
+for running a SPARQL server.
+
+There is no UI - all configuration is by command line and all usage by via the
+network protocols.
+
+Databases can be mounted outside the docker container so they are preserved when
+the container terminates.
+
+This build system allows the user to customize the docker image.
+
+The docker build downloads the server binary from 
+[Maven central](https://repo1.maven.org/maven2/org/apache/jena/jena-fuseki-server/),
+checking the download against the SHA1 checksum.
+
+## Database
+
+There is a volume mapping "./databases" in the current diectory into the server.
+This can be used to contain databases outside, but accessible to, the container
+that do not get deleted when the container exits.
+
+See examples below.
+
+## Build
+
+Choose the version number of Apache Jena release you wish to use. This toolkit
+defaults to the version of the overall Jena release it was part of. It is best
+to use the release of this set of tools from the same release of the desired
+server.
+
+    docker-compose build --build-arg JENA_VERSION=3.16.0
+
+Note the build command must provide the version number.
+
+## Run
+
+Examples:
+
+Start Fuseki with an in-memory, updatable dataset at http://<i>host</i>:3030/ds
+
+    docker-compose run --rm --service-ports fuseki --mem /ds
+
+Load a TDB2 database, and expose, read-only, via docker:
+
+    mkdir -p databases/DB2
+    tdb2.tdbloader --loc databases/DB2 MyData.ttl
+    # Publish read-only
+    docker-compose run --rm --name MyServer --service-ports fuseki --tdb2 --loc databases/DB2 /ds

Review comment:
       To pass in arguments without modifying the `docker-compose.yaml` and also in the same style as running Fuseki not in docker.

##########
File path: jena-fuseki2/jena-fuseki-docker/Dockerfile
##########
@@ -0,0 +1,112 @@
+## 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.
+
+## Apache Jena Fuseki server Dockerfile.
+
+## This Dockefile builds a reduced footprint container.
+
+ARG OPENJDK_VERSION=14
+ARG ALPINE_VERSION=3.12.0
+ARG JENA_VERSION=unset
+
+# Internal, passed between stages.
+ARG JAVA_MINIMAL=/opt/java-minimal
+ARG FUSEKI_DIR=/fuseki
+ARG FUSEKI_JAR=jena-fuseki-server-${JENA_VERSION}.jar
+
+## ---- Stage: Download and build java.
+FROM openjdk:${OPENJDK_VERSION}-alpine AS base
+ARG JENA_VERSION
+ARG JAVA_MINIMAL
+ARG FUSEKI_DIR
+ARG FUSEKI_JAR
+
+ARG REPO=https://repo1.maven.org/maven2
+ARG JAR_URL=${REPO}/org/apache/jena/jena-fuseki-server/${JENA_VERSION}/${FUSEKI_JAR}
+
+RUN [ "${JENA_VERSION}" != "unset" ] || { echo -e '\n**** Set JENA_VERSION ****\n' ; exit 1 ; }
+
+RUN echo && echo "==== Docker build for Apache Jena Fuseki ${JENA_VERSION} ====" && echo
+
+# Alpine: For objcopy used in jlink
+RUN apk add --no-cache curl binutils
+
+## -- Fuseki installed and runs in /fuseki.
+WORKDIR $FUSEKI_DIR
+
+## -- Download the jar file.
+COPY download.sh .
+RUN chmod a+x download.sh
+
+RUN ./download.sh --chksum sha1 "$JAR_URL"
+
+## -- Alternative to download : copy already downloaded.
+## COPY ${FUSEKI_JAR} .
+
+## -- Make reduced Java JDK
+RUN \
+  JDEPS="$(jdeps --multi-release base --print-module-deps --ignore-missing-deps ${FUSEKI_JAR})" && \

Review comment:
       Input for jlink.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org