forked from powerapi-ng/hwpc-sensor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
28 lines (27 loc) · 1.26 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
# builder image (build tools + development dependencies):
FROM debian:buster as builder
ARG BUILD_TYPE=Debug
ARG MONGODB_SUPPORT=ON
RUN apt update && \
apt install -y build-essential git clang-tidy cmake pkg-config libczmq-dev libpfm4-dev libsystemd-dev uuid-dev && \
echo "${MONGODB_SUPPORT}" |grep -iq "on" && apt install -y libmongoc-dev || true
COPY . /usr/src/hwpc-sensor
RUN cd /usr/src/hwpc-sensor && \
mkdir build && \
cd build && \
GIT_TAG=$(git describe --tags --dirty 2>/dev/null || echo "unknown") \
GIT_REV=$(git rev-parse HEAD 2>/dev/null || echo "unknown") \
cmake -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" -DCMAKE_C_CLANG_TIDY="clang-tidy" -DWITH_MONGODB="${MONGODB_SUPPORT}" .. && \
make -j $(getconf _NPROCESSORS_ONLN)
# runner image (only runtime depedencies):
FROM debian:buster as runner
ARG BUILD_TYPE=Debug
ARG MONGODB_SUPPORT=ON
RUN apt update && \
apt install -y libczmq4 libpfm4 && \
echo "${MONGODB_SUPPORT}" |grep -iq "on" && apt install -y libmongoc-1.0-0 || true && \
echo "${BUILD_TYPE}" |grep -iq "debug" && apt install -y libasan5 libubsan1 || true && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/src/hwpc-sensor/build/hwpc-sensor /usr/bin/hwpc-sensor
ENTRYPOINT ["/usr/bin/hwpc-sensor"]
CMD ["--help"]