Docker files need an update

Hi,
First of all, a big thank you for the amazing work !
I have been benchmarking Grapphhopper against OSRM and Graphhopper seems to be more accurate and more flexible than OSRM in many areas.

Now while testing Grapphopper I’ve run into several issues. I’m using the master branch. Also, I’m neither a Java or Docker expert so everything that follows may well be wrong.

Since there was a docker-compose/dockerfile available I tried using them. They don’t work out of the box. Here are a few things that seem outdated:

  • The Dockerfile calls a ./graphhopper.sh buildweb command which has been removed since d6f14bc7b42e647d7402f3551a03c38f50fe539d and replaced with build
  • The default config binds the web server to localhost which is incompatible with docker (needs it to bind to 0.0.0.0)
  • I’m wasn’t able to reach the jetty server on port 11111 and had to add the 8989 port binding to be able reach the API (BTW I’m not sure what’s supposed to run on port 11111)

Is this correct or did I miss something ?

1 Like

Yeah, we refactored several things in 0.11 but forgot about docker.

I’m also no real docker export … but will the following changes fix the problems you have?

1 Like

Hi karusell,
Thank you for your help.

I think there are two sides to this issue:

  • Dockerfile, I was able to get it to work using:
docker build . -t graphhopper-docker-fix
docker run -d --name graphhopper-docker-fix -v <path-to-repo>/data:/data -p 11111:11111 graphhopper-docker-fix:latest

The -p 11111:11111 is required to be able to reach the api in the container from outside the container.

  • core/files/docker-compose.yml: which your changes do not fix but the readme on github recommends. Maybe this one could be deleted and a bit of documentation around the Dockerfile could be added (I’m willing to spend some time on it, if you want).
1 Like

Thanks for your feedback, will try to fix this or if you have time for a pull request this would be appreciated too :slight_smile:

1 Like

Ok I’ll try to submit a pull request.

1 Like

Do I need to locally build the sources using the dockerfile? It is possible to upload a docker container to docker hub when releasing a new version?

Ignore my last comment, I was using the wrong image name. I needed to use graphhopper/graphhopper… :-/

OK, I managed to make it work and use my pbf file to create the car profile.
My next challenge is to be able to override the config file.
When using the command with /data/israel-and-palestine-latest.osm.pbf -c /data/config.yml I get an error: no file specified? | Usage:...
I’ve placed the config file inside the data folder. Do I need to configure a different folder to mount the graphhopper folder inside the container?
Any help would be appreciated.
— Edit —
Seems like the problem was with my command parameter for docker compose - It used the entire line as a single parameter…
Solution can be seen here:

Powered by Discourse