Public Repository

Last pushed: 5 months ago
Short Description
Dockerfile for latest osrm-backend
Full Description

The image is built using

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

  • v0.0: v5.7.0-latest.6

Run it:

$ docker run -d -p 5000:5000 pengma/osrm-backend-docker:v0.0 osrm label "http://download.geofabrik.de/europe/british-isles-latest.osm.pbf"

$ docker run -d -p 5000:5000 pengma/osrm-backend-docker:v0.0 osrm label "http://download.geofabrik.de/europe/ireland-and-northern-ireland-latest.osm.pbf"

Explanation:

-d run container in background and print container ID
-p 5000:5000 publish a container port to host
osrm go via entrypoint script, w/o osrm keyword - classic mode
label your label of OSM data
url link to OSM data in PBF format

For example:

$ docker run -d -p 5000:5000 --name osrm-api pengma/osrm-backend-docker:v0.0 osrm Ireland "http://download.geofabrik.de/europe/ireland-and-northern-ireland-latest.osm.pbf"

To query:

http://192.168.99.100:5000/route/v1/car/-1.470080,53.381143;-1.419082,53.399720?steps=true , where the 192.168.99.100 is the local broadcast IP.

Start OSRM Frontend

$ docker run -d --link osrm-api:api --name osrm-mos-front --restart=always -p 8080:80 pengma/osrm-frontend-docker


To increase the memory on docker machine, this works on Mac, not tested on Windows, but not working on Linux

$ docker-machine stop
$ VBoxManage modifyvm default --cpus 2
$ VBoxManage modifyvm default --memory 4096
$ docker-machine start

API docs

http://project-osrm.org/docs/v5.5.1/api/?language=Python#general-options

Upgrade docker machine on Mac

$ docker-machine upgrade default

Default Docker machine is stored at following and can be deleted

/Users/yourusername/.docker/machine/machines/default

Save the docker image out to local drive

$ docker save -o <save image to path> <image name>

Load image into docker

$ docker load -i <path to image tar file>

Remove all exited containers

$ docker rm $(docker ps -a -f status=exited -q)
$ docker volume rm $(docker volume ls -qf dangling=true)

List dangling volumes:

$ docker volume ls -qf dangling=true

List all volumes:

$ docker volume ls

Remove all the unused Images.

$ docker rmi $(docker images | grep "^<none>" | awk "{print $3}")

Export Save Docker images and container

  • Save the container
    $ docker ps
    CONTAINER ID IMAGE COMMAND
    defc757ce803 ubuntu "/bin/bash"
    $ docker export defc757ce803 | gzip > ubuntu.tar.gz
    $ ls -lah ubuntu.tar.gz
    $ gzcat ubuntu.tar.gz | docker import - ubuntu-alice
    $ docker run -t -i ubuntu-alice /bin/bash
  • This is now for saving the images
    $ docker save ubuntu | gzip > ubuntu-golden.tar.gz
    $ gzcat ubuntu-golden.tar.gz | docker load
    $ docker run -i -t ubuntu /bin/bash
  • Increase the size of the VM storage
    $ boot2docker init -s 40000
Docker Pull Command
Owner
pengma

Comments (0)