Merge pull request #14 from Telenav/feature/docker-orchestration

Telenav osrm-backend docker for development&release
This commit is contained in:
Xun(Perry) Liu 2019-06-14 15:14:02 -07:00 committed by GitHub
commit fab977355b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 123 additions and 0 deletions

View File

@ -0,0 +1,10 @@
# Docker Orchestration
## Docker Images
### osrm-backend-dev
Base image for telenav osrm-backend development, include all building and running dependencies.
See details in [osrm-backend-dev docker](./osrm-backend-dev/).
### osrm-backend
Image within built osrm binaries(`osrm-extract/osrm-partition/osrm-customize/...`) and running dependencies.
See details in [osrm-backend docker](./osrm-backend/)

View File

@ -0,0 +1,44 @@
FROM debian:stretch-slim
# Install necessary packages for proper system state
RUN DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
build-essential \
cmake \
curl \
wget \
tmux \
vim \
git \
libboost-all-dev \
libbz2-dev \
libtbb-dev \
libxml2-dev \
libzip-dev \
lua5.2 \
liblua5.2-dev \
libluabind-dev \
pkg-config
# install go
RUN wget --progress=dot:mega https://dl.google.com/go/go1.12.5.linux-amd64.tar.gz && \
tar -zxf go1.12.5.linux-amd64.tar.gz && \
mv go /usr/local/ && \
rm -f go1.12.5.linux-amd64.tar.gz && \
mkdir -p /workspace/go/bin /workspace/go/src /workspace/go/pkg
# set env
ENV GO_HOME=/usr/local/go
ENV PATH=${GO_HOME}/bin/:$PATH
ENV GOPATH=/workspace/go
# install thrift 0.12.0 go pkg
RUN cd /workspace/go && \
mkdir -p src/github.com/apache && \
cd src/github.com/apache && \
git clone -b 0.12.0 https://github.com/apache/thrift.git && \
cd thrift && \
git branch && \
cd /workspace/go && \
go install github.com/apache/thrift/lib/go/thrift

View File

@ -0,0 +1,9 @@
# osrm-backend-dev docker
## Build Image
```bash
$ cd docker-orchestration/osrm-backend-dev
$ DOCKER_BUILDKIT=1 docker build -t telenav/osrm-backend-dev .
```

View File

@ -0,0 +1,46 @@
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 && \
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 && \
rm -rf /var/lib/apt/lists/*
RUN mkdir /osrm-build
COPY --from=builder /osrm-build /osrm-build/
COPY --from=gobuilder /workspace/go/bin /osrm-build/

View File

@ -0,0 +1,14 @@
# telenav osrm-backend docker
## Build Image
```bash
$ cd docker-orchestration/osrm-backend
# build source from default branch master-telenav
$ DOCKER_BUILDKIT=1 docker build -t telenav/osrm-backend .
# build source from specified branch, e.g. feature/telenav-import-internal-pbf
$ DOCKER_BUILDKIT=1 docker build -t telenav/osrm-backend:telenav-import-internal-pbf --build-arg BRANCH_NAME=feature/telenav-import-internal-pbf .
```