45 lines
1.5 KiB
Docker
45 lines
1.5 KiB
Docker
FROM docker.io/arm64v8/debian:bookworm AS builder
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
clang make cmake git pkg-config ca-certificates \
|
|
libboost-all-dev libtbb-dev liblua5.4-dev \
|
|
libxml2-dev libzip-dev libbz2-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
ARG OSRM_VERSION=v5.27.1
|
|
RUN git clone --depth=1 --branch ${OSRM_VERSION} \
|
|
https://github.com/Project-OSRM/osrm-backend.git /osrm
|
|
|
|
RUN cd /osrm && mkdir build && cd build && \
|
|
cmake .. -DCMAKE_BUILD_TYPE=Release \
|
|
-DCMAKE_C_COMPILER=clang \
|
|
-DCMAKE_CXX_COMPILER=clang++ \
|
|
-DOSRM_BUILD_TESTS=OFF \
|
|
-DOSRM_BUILD_TOOLS=OFF && \
|
|
make -j$(nproc) osrm-extract osrm-partition osrm-customize osrm-routed && \
|
|
make install
|
|
|
|
# ---- runtime ----
|
|
FROM docker.io/arm64v8/debian:bookworm-slim
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
libboost-filesystem1.81.0 \
|
|
libboost-iostreams1.81.0 \
|
|
libboost-regex1.81.0 \
|
|
libboost-date-time1.81.0 \
|
|
libboost-thread1.81.0 \
|
|
libboost-program-options1.81.0 \
|
|
libtbb12 liblua5.4-0 libxml2 libzip4 libbz2-1.0 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=builder /usr/local/bin/osrm-extract \
|
|
/usr/local/bin/osrm-partition \
|
|
/usr/local/bin/osrm-customize \
|
|
/usr/local/bin/osrm-routed \
|
|
/usr/local/bin/
|
|
|
|
# Lua profiles (car.lua, foot.lua, bicycle.lua, etc.)
|
|
COPY --from=builder /osrm/profiles/ /opt/
|
|
|
|
WORKDIR /data
|
|
EXPOSE 5000
|