Allow docker image with assertions (#4016)
This commit is contained in:
parent
45ee096260
commit
6d2353c302
@ -69,6 +69,15 @@ In case Docker complains about not being able to connect to the Docker daemon ma
|
|||||||
|
|
||||||
After adding yourself to the `docker` group make sure to log out and back in again with your terminal.
|
After adding yourself to the `docker` group make sure to log out and back in again with your terminal.
|
||||||
|
|
||||||
|
We support the following images on Docker Cloud:
|
||||||
|
|
||||||
|
Name | Description
|
||||||
|
-----|------
|
||||||
|
`latest` | `master` compiled with release flag
|
||||||
|
`latest-assertions` | `master` compiled with with release flag, assertions enabled and debug symbols
|
||||||
|
`latest-debug` | `master` compiled with debug flag
|
||||||
|
`<tag>` | specific tag compiled with release flag
|
||||||
|
`<tag>-debug` | specific tag compiled with debug flag
|
||||||
|
|
||||||
### Building from Source
|
### Building from Source
|
||||||
|
|
||||||
|
@ -1,15 +1,9 @@
|
|||||||
FROM alpine:3.5
|
FROM alpine:3.5
|
||||||
|
|
||||||
ARG DOCKER_TAG
|
|
||||||
|
|
||||||
RUN mkdir /src
|
|
||||||
COPY . /src
|
|
||||||
|
|
||||||
RUN mkdir /opt
|
RUN mkdir /opt
|
||||||
WORKDIR /opt
|
WORKDIR /opt
|
||||||
|
|
||||||
RUN NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
|
RUN NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
|
||||||
case ${DOCKER_TAG} in *"-debug"*) BUILD_TYPE="Debug";; *) BUILD_TYPE="Release";; esac && \
|
|
||||||
\
|
|
||||||
echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
|
echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
|
||||||
apk update && \
|
apk update && \
|
||||||
apk upgrade && \
|
apk upgrade && \
|
||||||
@ -23,15 +17,26 @@ RUN NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
|
|||||||
cd build && \
|
cd build && \
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release .. && \
|
cmake -DCMAKE_BUILD_TYPE=Release .. && \
|
||||||
make -j${NPROC} && \
|
make -j${NPROC} && \
|
||||||
make install && \
|
make install
|
||||||
\
|
|
||||||
|
ARG DOCKER_TAG
|
||||||
|
RUN mkdir /src
|
||||||
|
COPY . /src
|
||||||
|
WORKDIR /src
|
||||||
|
|
||||||
|
RUN NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
|
||||||
echo "Building OSRM ${DOCKER_TAG}" && \
|
echo "Building OSRM ${DOCKER_TAG}" && \
|
||||||
cd /src && \
|
|
||||||
git show --format="%H" | head -n1 > /opt/OSRM_GITSHA && \
|
git show --format="%H" | head -n1 > /opt/OSRM_GITSHA && \
|
||||||
echo "Building OSRM gitsha $(cat /opt/OSRM_GITSHA)" && \
|
echo "Building OSRM gitsha $(cat /opt/OSRM_GITSHA)" && \
|
||||||
mkdir build && \
|
mkdir build && \
|
||||||
cd build && \
|
cd build && \
|
||||||
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DENABLE_LTO=On .. && \
|
BUILD_TYPE="Release" && \
|
||||||
|
ENABLE_ASSERTIONS="Off" && \
|
||||||
|
BUILD_TOOLS="Off" && \
|
||||||
|
case ${DOCKER_TAG} in *"-debug"*) BUILD_TYPE="Debug";; esac && \
|
||||||
|
case ${DOCKER_TAG} in *"-assertions"*) BUILD_TYPE="RelWithDebInfo" && ENABLE_ASSERTIONS="On" && BUILD_TOOLS="On";; esac && \
|
||||||
|
echo "Building ${BUILD_TYPE} with ENABLE_ASSERTIONS=${ENABLE_ASSERTIONS} BUILD_TOOLS=${BUILD_TOOLS}" && \
|
||||||
|
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS} -DBUILD_TOOLS=${BUILD_TOOLS} -DENABLE_LTO=On && \
|
||||||
make -j${NPROC} install && \
|
make -j${NPROC} install && \
|
||||||
cd ../profiles && \
|
cd ../profiles && \
|
||||||
cp -r * /opt && \
|
cp -r * /opt && \
|
||||||
|
Loading…
Reference in New Issue
Block a user