Skip to content

Docker Recipes

Alex Kavon edited this page Nov 30, 2018 · 10 revisions

We publish ready to use lightweight Docker images based on Alpine Linux for each OSRM release:

https://hub.docker.com/r/osrm/osrm-backend/

They can be used via

wget http://download.geofabrik.de/europe/monaco-latest.osm.pbf

docker run -t -v $(pwd):/data osrm/osrm-backend:vX.Y.Z osrm-extract -p /opt/car.lua /data/monaco-latest.osm.pbf
docker run -t -v $(pwd):/data osrm/osrm-backend:vX.Y.Z osrm-contract /data/monaco-latest.osrm
docker run -t -i -p 5000:5000 -v $(pwd):/data osrm/osrm-backend:vX.Y.Z osrm-routed /data/monaco-latest.osrm

curl 'http://localhost:5000/route/v1/driving/7.436828612,43.739228054975506;7.417058944702148,43.73284046244549?steps=true'

Replace X.Y.Z with the latest stable OSRM image tag you want to run.

Check the published tags here.

You can now hook up a frontend, for this see:

https://github.com/Project-OSRM/osrm-frontend

These images are created via utilities here:

https://github.com/Project-OSRM/osrm-backend-docker

Note on STXXL usage

If you're processing big files, you may want to customize the STXXL configuration. In this case, the easiest thing to do is put the .stxxl configuration file in the same location as your .osm.pbf files - these get mounted in /data inside the container, and the working directory is set to that location when the container starts - the .stxxl file will be automatically read and used.

You can’t perform that action at this time.