-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
46 lines (38 loc) · 1.19 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
FROM python:3.9
# Environment
ENV OSRM_VERSION 5.26.0
ENV LD_LIBRARY_PATH=/usr/local/lib
ENV BUILD_DIR /usr/src
WORKDIR /usr/local/app
# Sources
ADD https://github.com/Project-OSRM/osrm-backend/archive/v${OSRM_VERSION}.tar.gz ${BUILD_DIR}
ADD . ${BUILD_DIR}
# Install OSRM dependencies
RUN apt-get -qq update
RUN apt-get -qqy install --no-install-recommends \
build-essential \
wget cmake pkg-config \
libbz2-dev libxml2-dev \
libzip-dev libboost-all-dev \
lua5.2 liblua5.2-dev libtbb-dev
RUN apt-get -qqy clean
RUN apt-get -qqy autoremove
RUN apt-get -qqy autoclean
RUN rm -rf /var/lib/apt/lists/*
# Compile and install OSRM
RUN cd ${BUILD_DIR} \
&& tar -xvf v${OSRM_VERSION}.tar.gz \
&& cd osrm-backend-${OSRM_VERSION} \
&& mkdir -p build \
&& cd build \
&& cmake .. -DCMAKE_BUILD_TYPE=Release \
&& cmake --build . -- -j $(nproc) \
&& cmake --build . --target install -- -j $(nproc)
# Install Python requirements
RUN cd ${BUILD_DIR} \
&& python -m pip install --no-cache-dir -r requirements.txt
# Compile and install Python OSRM binding
RUN cd ${BUILD_DIR} && cd libosrmc/ && ./build.sh
RUN cd ${BUILD_DIR} && python -m pip install .
# Clean
RUN rm -rf ${BUILD_DIR}/*