wget https://download.geofabrik.de/asia/gcc-states-latest.osm.pbf
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-extract -p /opt/car.lua /data/gcc-states-latest.osm.pbf
Note: The flag -v "${PWD}:/data"
creates the directory /data
inside the docker container and makes the current working directory "${PWD}"
available there. The file /data/*.osm.pbf
inside the container is referring to "${PWD}/*.osm.pbf"
on the host.
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-partition /data/gcc-states-latest.osrm
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-customize /data/gcc-states-latest.osrm
docker run -t -i -p 5000:5000 -v "${PWD}:/data" osrm/osrm-backend osrm-routed --algorithm mld /data/gcc-states-latest.osrm
Voila! You're done. Now you can test out the server running on port 5000
curl "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true"
Sources: