On 06/09/15 22:41, Alex Muir wrote:
Greetings,

I've modified a dockerfile I found online so it works with
apache-jena-fuseki-2.3.1-SNAPSHOT.

It's installed here http://oup-demo2.kode1100.com:3030/dataset.html

I find however that none of the relevant interface links work such as to
manage datasets.

I did an s-put of a small rdf file to the ds oup/ which runs without
error however this is not apparent from the web interface which does not
display the data.

i wonder if there is a missing package in the following something
related to getting the web interface to work?

     apt-get update --fix-missing && \
     apt-get install -y tar locales git oracle-java8-installer  maven
ruby --fix-missing

Regards
Alex
www.tilogeo.com <http://www.tilogeo.com>

Hi Alex,

By the looks of things, this isn't a docker issue per se although docker makes it more complicated. The problem is "localhost".

By default (you can change this), the UI only works for localhost because it has the capability to make changes, create datasets etc.

That is controlled by the shiro.ini file

...
[urls]
## Control functions open to anyone
/$/status = anon
/$/ping   = anon

## and the rest are restricted to localhost.
/$/** = localhostFilter
...

There are instructions in that file to switch to using user/password control.

"localhost" means the request comes from the "Local loopback interface", "lo" 127.0.0.1 or ::1/128. In docker, it is different inside a running docker container from the host. A same-machine request is not coming from the server localhost.

The easy hack, but understand the consequences first, is "--net:host". The container runs on the host stack. You don't even need to map the port. BUT the container and host are not so isolated from each other.

(General docker comment: if you want to run the client in a container on the same host as a server of some kind and have localhost work, you can run docker with "--net container:NAME" where the server container is called fuseki. Just the client container and server share stacks, better, not perfect. https://github.com/docker/docker/issues/1143)

        Andy

Simple "run Fuseki" script for docker:

-----------------------------------------
#!/bin/bash

# Installation directory : change as needed.
DIR="/home/afs/jlib/apache-jena-fuseki-2.3.0"
# Caution: --net=host

docker run -it --rm --name Fuseki2 \
       -v ${DIR}:/fuseki \
       --net=host \
       java:8 \
       env FUSEKI_HOME=/fuseki /fuseki/fuseki-server --update --mem /ds
-----------------------------------------



Reply via email to