1

I'm preparing a Docker image to teach my students the basics of Linked Data. I want them to actually prepare proper RDF and simulate the process of publishing it on the web as Linked Data, so I have prepared a Docker image comprising:

  • Triple Store: Blazegraph, listening to port 9999.
  • GRefine. I have copied an instance of Open Refine, with the RDF extension included. Listening to port 3333.
  • Linked Data Server: I have copied an instance of Jetty, with Pubby inside it. Listening to port 8080.

I have tested the three in my localhost (runing Ubuntu 14.04) and they work fine. This is the Dockerfile I'm using to build the image:

FROM ubuntu:14.04
MAINTAINER Mikel Egaña Aranguren <my.email@x.com>

RUN apt-get update && apt-get install -y openjdk-7-jre wget curl

RUN mkdir /LinkedDataServer

COPY google-refine-2.5 /LinkedDataServer/google-refine-2.5
COPY blazegraph /LinkedDataServer/blazegraph
COPY jetty /LinkedDataServer/jetty

EXPOSE 9999
EXPOSE 3333
EXPOSE 8080

WORKDIR /LinkedDataServer
CMD java -server -jar blazegraph/bigdata-bundled.jar 
CMD google-refine-2.5/refine -i 0.0.0.0

WORKDIR /LinkedDataServer/jetty
CMD java -jar start.jar jetty.port=8080

I run the container and it does map the appropriate ports:

docker run -d -p 9999:9999 -p 3333:3333 -p 8080:8080 mikeleganaaranguren/linked-data-server:0.0.1

CONTAINER ID        IMAGE                                          COMMAND                CREATED             STATUS              PORTS                                                                    NAMES
a08709d23acb        mikeleganaaranguren/linked-data-server:0.0.1   /bin/sh -c 'java -ja   5 seconds ago       Up 4 seconds        0.0.0.0:3333->3333/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:9999->9999/tcp   dreamy_engelbart 

The triple store, for example, seems to be working. If I go to 127.0.0.1:9999, I can access the triple store:

Blazegraph working

However, if try to do anything (queries, upload data, ...), the triple store simply fails with an "ERROR: Could not contact server". Since the same setting works on the host, I assume I'm doing something wrong with Docker. I have tried with -P instead of mapping the ports, and with --net=host, but I get the same error.

PS: Jetty also fails in the same fashion, and GRefine is not even working.

honk
  • 9,137
  • 11
  • 75
  • 83
  • Update: even though I can access blazegraph through the web, executing a query fails (connection reset by peer): wget http://127.0.0.1:9999/bigdata/sparql?query=select%20*%20where%20{%20?s%20?p%20?o%20}%20limit%201. – Mikel Egaña Aranguren Oct 28 '15 at 15:05
  • When I "enter" (-i -t) the container and run blazegraph manually, however, I can execute the wget above both against localhost and the container's IP. – Mikel Egaña Aranguren Oct 28 '15 at 15:08

1 Answers1

1

You'll need to make sure to use the IP of the docker container to access the Blazegraph instance. Outside of the container, it will not be running on 127.0.0.1, but rather the IP assigned to the docker container.

You'll need to run something like

docker inspect --format '{{ .NetworkSettings.IPAddress }}' "CONTAINER ID"

Where CONTAINER ID is the value of your docker instance.

Brad Bebee
  • 146
  • 3
  • I'm still getting the same error. I can access http://127.0.0.1:9999/bigdata/#splash but then if I access the container's IP (obtained with inspect, 172.17.0.4) the connection is refused: mikel@durruti:~$wget http://172.17.0.4:9999/bigdata/sparql?query=select%20*%20where%20{%20?s%20?p%20?o%20}%20limit%201 Konektatzen 172.17.0.4:9999... huts egin da: Connection refused Thanks – Mikel Egaña Aranguren Oct 28 '15 at 15:47