Running OSRM with Docker

2017-10-07 Docker OSRM Andrew B. Collier

I’ve now been through the process of setting up OSRM a few times. While it’s not exactly taxing, it seemed like a prime candidate for automation.

Although there are existing Docker images for OSRM, I elected to roll my own to have a little more control. You can find the Dockerfile and a startup script here.

To use, do as follows:

  1. Build the image.

    $ docker build -t osrm:latest .
  2. Download map data. For the sake of illustration, we’ll assume that the resulting file is called map.xml.

  3. Launch a container.

    $ docker run -p 5000:5000 -v `pwd`:/data osrm:latest map.xml

The image exposes the service on port 5000, which is mapped to port 5000 on the host. Now go ahead and submit requests!

Next: Installing NVIDIA Graphics Driver on Ubuntu.
Previous: Exporting HTML Presentations to PDF.