-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
83 lines (51 loc) · 1.82 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# syntax=docker/dockerfile:1
FROM debian:bullseye-slim as builder
ARG BUILD_TYPE=Release
ARG INSTALL_PREFIX=/usr
ARG SHMAPS_SEG_SIZE
WORKDIR /deps
COPY .devcontainer/base-scripts/build-deps.sh .
COPY .devcontainer/base-scripts/deps.apt .
RUN ./build-deps.sh $BUILD_TYPE $INSTALL_PREFIX
FROM builder as reset
ARG BUILD_TYPE=Release
ARG SHMAPS_SEG_SIZE
WORKDIR /build
COPY include/ include/
COPY src/reset/ src/reset/
WORKDIR /build/src/reset
RUN cmake -E make_directory "build" \
&& cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSHMAPS_SEG_SIZE=$SHMAPS_SEG_SIZE -S . -B "build" \
&& cmake --build "build" --config $BUILD_TYPE
FROM builder as test
ARG BUILD_TYPE=Release
ARG SHMAPS_SEG_SIZE
ENV CXXFLAGS="-std=c++11 -stdlib=libc++"
WORKDIR /build
COPY include/ include/
COPY src/test/ src/test/
WORKDIR /build/src/test
RUN cmake -E make_directory "build" \
&& cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSHMAPS_SEG_SIZE=$SHMAPS_SEG_SIZE -S . -B "build" \
&& cmake --build "build" --config $BUILD_TYPE
FROM builder as bench
ARG BUILD_TYPE=Release
ARG SHMAPS_SEG_SIZE
ENV CXXFLAGS="-std=c++11 -stdlib=libc++"
WORKDIR /build
RUN apt update \
&& apt install -y \
libhiredis-dev \
redis-server \
&& rm -rf /var/lib/apt/lists/*
RUN git clone --branch v1.7.1 https://github.com/google/benchmark.git benchmark \
&& cd benchmark \
&& cmake -E make_directory "build" \
&& cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBENCHMARK_ENABLE_TESTING=OFF -DBENCHMARK_USE_LIBCXX=ON -S . -B "build" \
&& cmake --build "build" --config $BUILD_TYPE --target install
COPY include/ include/
COPY src/bench/ src/bench/
WORKDIR /build/src/bench
RUN cmake -E make_directory "build" \
&& cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSHMAPS_SEG_SIZE=$SHMAPS_SEG_SIZE -S . -B "build" \
&& cmake --build "build" --config $BUILD_TYPE