|
1 | | -ARG FUSEKI_VERSION=latest |
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one or more |
| 2 | +# contributor license agreements. See the NOTICE file distributed with |
| 3 | +# this work for additional information regarding copyright ownership. |
| 4 | +# The ASF licenses this file to You under the Apache License, Version 2.0 |
| 5 | +# (the "License"); you may not use this file except in compliance with |
| 6 | +# the License. You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
2 | 15 |
|
3 | | -FROM stain/jena-fuseki:${FUSEKI_VERSION} |
4 | 16 |
|
5 | | -RUN apt-get update; \ |
6 | | - apt-get install -y --no-install-recommends procps |
| 17 | +FROM openjdk:11-jre-slim-buster |
| 18 | +MAINTAINER Stian Soiland-Reyes < [email protected]> |
| 19 | + |
| 20 | +ENV LANG C.UTF-8 |
| 21 | +RUN set -eux; \ |
| 22 | + apt-get update; \ |
| 23 | + apt-get install -y --no-install-recommends \ |
| 24 | + bash curl ca-certificates findutils coreutils gettext pwgen procps tini \ |
| 25 | + ; \ |
| 26 | + rm -rf /var/lib/apt/lists/* |
| 27 | + |
| 28 | + |
| 29 | +# Update below according to https://jena.apache.org/download/ |
| 30 | +# and checksum for apache-jena-fuseki-4.x.x.tar.gz.sha512 |
| 31 | +ENV FUSEKI_SHA512 359f8f99c8fa5968c1bdddcc39214db86da822804e3dd5fa182b86daff2d121a85b2102cffec853d9a80ceca7dea8ef65ef875919d653984af9bd297bc740167 |
| 32 | +ENV FUSEKI_VERSION 4.2.0 |
| 33 | +# No need for https due to sha512 checksums below |
| 34 | +ENV ASF_MIRROR http://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename= |
| 35 | +ENV ASF_ARCHIVE http://archive.apache.org/dist/ |
| 36 | + |
| 37 | +LABEL org.opencontainers.image.url https://github.com/stain/jena-docker/tree/master/jena-fuseki |
| 38 | +LABEL org.opencontainers.image.source https://github.com/stain/jena-docker/ |
| 39 | +LABEL org.opencontainers.image.documentation https://jena.apache.org/documentation/fuseki2/ |
| 40 | +LABEL org.opencontainers.image.title "Apache Jena Fuseki" |
| 41 | +LABEL org.opencontainers.image.description "Fuseki is a SPARQL 1.1 server with a web interface, backed by the Apache Jena TDB RDF triple store." |
| 42 | +LABEL org.opencontainers.image.version ${FUSEKI_VERSION} |
| 43 | +LABEL org.opencontainers.image.licenses "(Apache-2.0 AND (GPL-2.0 WITH Classpath-exception-2.0) AND GPL-3.0)" |
| 44 | +LABEL org.opencontainers.image.authors "Apache Jena Fuseki by https://jena.apache.org/; this image by https://orcid.org/0000-0001-9842-9718" |
| 45 | + |
| 46 | +# Config and data |
| 47 | +ENV FUSEKI_BASE /fuseki |
| 48 | + |
| 49 | + |
| 50 | +# Installation folder |
| 51 | +ENV FUSEKI_HOME /jena-fuseki |
| 52 | + |
| 53 | +WORKDIR /tmp |
| 54 | +# published sha512 checksum |
| 55 | +RUN echo "$FUSEKI_SHA512 fuseki.tar.gz" > fuseki.tar.gz.sha512 |
| 56 | +# Download/check/unpack/move in one go (to reduce image size) |
| 57 | +RUN (curl --location --silent --show-error --fail --retry-connrefused --retry 3 --output fuseki.tar.gz ${ASF_MIRROR}jena/binaries/apache-jena-fuseki-$FUSEKI_VERSION.tar.gz || \ |
| 58 | + curl --fail --silent --show-error --retry-connrefused --retry 3 --output fuseki.tar.gz $ASF_ARCHIVE/jena/binaries/apache-jena-fuseki-$FUSEKI_VERSION.tar.gz) && \ |
| 59 | + sha512sum -c fuseki.tar.gz.sha512 && \ |
| 60 | + tar zxf fuseki.tar.gz && \ |
| 61 | + mv apache-jena-fuseki* $FUSEKI_HOME && \ |
| 62 | + rm fuseki.tar.gz* && \ |
| 63 | + cd $FUSEKI_HOME && rm -rf fuseki.war && chmod 755 fuseki-server |
| 64 | + |
| 65 | +# Test the install by testing it's ping resource. 20s sleep because Docker Hub. |
| 66 | +RUN $FUSEKI_HOME/fuseki-server & \ |
| 67 | + sleep 20 && \ |
| 68 | + curl -sS --fail 'http://localhost:3030/$/ping' |
| 69 | + |
| 70 | +# No need to kill Fuseki as our shell will exit after curl |
| 71 | + |
| 72 | +# As "localhost" is often inaccessible within Docker container, |
| 73 | +# we'll enable basic-auth with a random admin password |
| 74 | +# (which we'll generate on start-up) |
| 75 | +COPY shiro.ini $FUSEKI_HOME/shiro.ini |
| 76 | +COPY fuseki-entrypoint.sh /docker-entrypoint.sh |
| 77 | +RUN chmod 755 /docker-entrypoint.sh |
| 78 | + |
| 79 | + |
| 80 | +COPY load.sh $FUSEKI_HOME/ |
| 81 | +COPY tdbloader $FUSEKI_HOME/ |
| 82 | +COPY tdbloader2 $FUSEKI_HOME/ |
| 83 | +RUN chmod 755 $FUSEKI_HOME/load.sh $FUSEKI_HOME/tdbloader $FUSEKI_HOME/tdbloader2 |
| 84 | +#VOLUME /staging |
| 85 | + |
| 86 | + |
| 87 | +# Where we start our server from |
| 88 | +WORKDIR $FUSEKI_HOME |
| 89 | + |
| 90 | +# Make sure we start with empty /fuseki |
| 91 | +RUN rm -rf $FUSEKI_BASE |
| 92 | +VOLUME $FUSEKI_BASE |
| 93 | + |
| 94 | +EXPOSE 3030 |
| 95 | +ENTRYPOINT ["/usr/bin/tini", "--", "/docker-entrypoint.sh"] |
| 96 | +CMD ["/jena-fuseki/fuseki-server"] |
| 97 | + |
0 commit comments