osrm-backend/docker-orchestration/osrm-backend/Dockerfile
Xun(Perry) Liu 79d565b2ec Feature/docker orchestration perry (#19)
* fix: Fix the issue in shell script to build docker image

- Fix the issue in the if

* fix: Fix the issue in shell script to build docker image

- Fix the issue related with profile, currently use car.lua to build data

* fix: Fix the issue in shell script to build docker image

- Need curl installed in docker image to download pbf file

* fix: Fix the issue in shell script to build docker image

- To download osm data from geofabrik, need ca-certificates otherwise will meet error like:
curl: (77) error setting certificate verify locations

* doc: Add document to record how to use docker-orchestration/osrm-backend
2019-06-18 09:35:52 +08:00

54 lines
1.8 KiB
Docker

FROM wangyoucao577/osrm-backend-dev as builder
ARG BRANCH_NAME=master-telenav
RUN echo "Building branch ${BRANCH_NAME}" && \
git clone -b ${BRANCH_NAME} https://github.com/Telenav/osrm-backend.git && \
mkdir -p osrm-backend/build && \
cd osrm-backend/build && \
cmake .. -DENABLE_LTO=On && \
cmake --build . -- -j && \
mkdir /osrm-build && \
mkdir /osrm-data && \
cp /osrm-backend/build/osrm* /osrm-build/ && \
cp -r /osrm-backend/profiles /osrm-build/
FROM wangyoucao577/osrm-backend-dev as gobuilder
ARG BRANCH_NAME=master-telenav
WORKDIR /workspace/go
RUN echo "Building branch ${BRANCH_NAME}" && \
mkdir -p src/github.com/Telenav && \
cd src/github.com/Telenav && \
git clone -b ${BRANCH_NAME} https://github.com/Telenav/osrm-backend.git && \
cd ../../../ && \
if [ -d "src/github.com/Telenav/osrm-backend/traffic_updater/go/osrm_traffic_updater" ]; then \
go install github.com/Telenav/osrm-backend/traffic_updater/go/gen-go/proxy && \
go install github.com/Telenav/osrm-backend/traffic_updater/go/osrm_traffic_updater && \
ls -lh bin/ \
;fi
FROM debian:stretch-slim as runstage
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libboost-program-options1.62.0 libboost-regex1.62.0 \
libboost-date-time1.62.0 libboost-chrono1.62.0 libboost-filesystem1.62.0 \
libboost-iostreams1.62.0 libboost-thread1.62.0 expat liblua5.2-0 libtbb2 curl ca-certificates && \
rm -rf /var/lib/apt/lists/*
RUN mkdir /osrm-build
COPY --from=builder /osrm-build /osrm-build/
COPY --from=builder /osrm-data /osrm-data/
COPY --from=gobuilder /workspace/go/bin /osrm-build/
WORKDIR /osrm-build
# Publish
COPY ./docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]