Running OSRM with Docker
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:
- Build the image.
- Download map data. For the sake of illustration, we’ll assume that the resulting file is called
- Launch a container.
The image exposes the service on port 5000, which is mapped to port 5000 on the host. Now go ahead an submit requests!