Установка OSRM на Debian Jessie

Материал из razgovorov.ru
Перейти к: навигация, поиск

OSRM

BackEnd

Dockerfile для Debian jessie

FROM debian:jessie

RUN \
  DEBIAN_FRONTEND=noninteractive apt-get update && \
  DEBIAN_FRONTEND=noninteractive apt-get install -y \
    git apt-utils libstxxl-dev libxml2-dev libsparsehash-dev \
    libbz2-dev libzip-dev libgomp1 liblua5.1-0-dev libluabind-dev \
    pkg-config libgdal-dev libtbb-dev libexpat1-dev \
    libboost-dev libboost-filesystem-dev libboost-thread-dev  \
    libboost-system-dev libboost-regex-dev  libboost-program-options-dev  \
    libboost-iostreams-dev libboost-test-dev \
    g++ zlib1g-dev cmake wget

RUN \
  wget /opt https://github.com/Project-OSRM/osrm-backend/archive/v5.1.0.tar.gz -O - \
  | tar -xz -C /tmp && \
  mkdir -p /opt/osrm && \
  cd /opt/osrm && \
  cmake /tmp/osrm-backend-5.1.0 -DCMAKE_BUILD_TYPE=Release  && \
  cmake --build .  && \
  cmake --build . --target install && \
  mv /tmp/osrm-backend-5.1.0/profiles/car.lua profile.lua && \
  mv /tmp/osrm-backend-5.1.0/profiles/lib/ lib && \
  rm -rf /tmp/osrm-backend-5.1.0
WORKDIR /opt/osrm
ADD run.sh run.sh
EXPOSE 5000

[1]

FROM debian:jessie

RUN \
  DEBIAN_FRONTEND=noninteractive apt-get update && \
  DEBIAN_FRONTEND=noninteractive apt-get install -y \
      curl && \
  curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - && \
  DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs npm && \
  npm install -g browserify


RUN \
  wget /opt https://github.com/Project-OSRM/osrm-backend/archive/v5.1.0.tar.gz -O - \
  | tar -xz -C /tmp && \
  mkdir -p /opt/osrm && \
  cd /opt/osrm && \
  cmake /tmp/osrm-backend-5.1.0 -DCMAKE_BUILD_TYPE=Release  && \
  cmake --build .  && \
  cmake --build . --target install && \
  mv /tmp/osrm-backend-5.1.0/profiles/car.lua profile.lua && \
  mv /tmp/osrm-backend-5.1.0/profiles/lib/ lib && \
  rm -rf /tmp/osrm-backend-5.1.0
WORKDIR /opt/osrm
ADD run.sh run.sh
EXPOSE 5000

Установка docker

добавляем в конец /etc/apt/sources.list

deb http://ftp.debian.org/debian jessie-backports main

Обновляем репозиторий и устанавливаем докер

apt-get update
apt-get install docker.io


делаем папаку кладем туда Dockerfile, создаем контейнер docker build -t [имя группы]/[имя контейнера] [папка с dockerfile]

docker build -t businka/osrm ./osrm