-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
51 lines (46 loc) · 1.74 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
47
48
49
50
51
# OSRM processing tools, server and profile
FROM alpine:3.4
# This can be a gitsha, tag, or branch - anything that works with `git checkout`
ARG OSRM_VERSION
# This is passed to cmake for osrm-backend. All other dependencies are built in
# release mode.
ARG BUILD_TYPE=Release
RUN mkdir /opt
WORKDIR /opt
RUN NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
apk update && \
apk upgrade && \
apk add git cmake wget make libc-dev gcc g++ bzip2-dev boost-dev zlib-dev expat-dev lua5.1-dev libtbb@testing libtbb-dev@testing && \
\
echo "Building libstxxl" && \
cd /opt && \
git clone --depth 1 --branch 1.4.1 https://github.com/stxxl/stxxl.git && \
cd stxxl && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j${NPROC} && \
make install && \
\
echo "Building OSRM ${OSRM_VERSION}" &&\
cd /opt && \
git clone https://github.com/Project-OSRM/osrm-backend.git && \
cd osrm-backend && \
git checkout ${OSRM_VERSION} && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DENABLE_LTO=On .. && \
make -j${NPROC} install && \
cd ../profiles && \
cp -r * /opt && \
\
echo "Cleaning up" && \
strip /usr/local/bin/* && \
rm /usr/local/lib/libstxxl* && \
cd /opt && \
apk del boost-dev && \
apk del g++ cmake libc-dev expat-dev zlib-dev bzip2-dev lua5.1-dev git make gcc && \
apk add boost-filesystem boost-program_options boost-regex boost-iostreams boost-thread libgomp lua5.1 expat && \
rm -rf /opt/osrm-backend /opt/stxxl /usr/local/bin/stxxl_tool /usr/local/lib/libosrm*
EXPOSE 5000