-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (24 loc) · 830 Bytes
/
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
FROM alpine as flashpoint
RUN apk add gcc g++ cmake make git
RUN apk add linux-headers
ENV CC=gcc CXX=g++
WORKDIR /requirements
RUN git clone https://github.com/ninja-build/ninja.git && \
cd ninja && \
cmake -DCMAKE_MAKE_PROGRAM=make -Bbuild-cmake && \
cmake --build build-cmake
WORKDIR /service
ADD protos ./protos
ADD src ./src
ADD test ./test
ADD CMakeLists.txt .
# TODO: use ninja
RUN cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=make -B cmake-build-release .
RUN cmake --build cmake-build-release --target flashpoint -j 12
RUN cmake --build cmake-build-release --target flashpoint_test -j 12
WORKDIR /build
RUN mv /service/cmake-build-release/flashpoint .
ENTRYPOINT ./flashpoint
FROM flashpoint as flashpoint-test
RUN mv /service/cmake-build-release/flashpoint_test .
ENTRYPOINT ./flashpoint_test