-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
38 lines (32 loc) · 1.42 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
FROM debian:9.4 AS build
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
cmake \
libbsd-dev \
libdaemon-dev \
libcmocka-dev \
libmicrohttpd-dev \
ninja-build \
&& rm -rf /var/lib/apt/lists/*
COPY . /src/optics/
WORKDIR /src/optics/build
RUN cmake .. -G Ninja \
&& ninja -C . \
&& ctest . -L test \
&& ninja -C . install
FROM debian:9.4-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
libbsd0 \
libdaemon0 \
libmicrohttpd12 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build ["/usr/local/lib/liboptics.so", \
"/usr/local/lib/liboptics_static.a" \
"/usr/lib"]
COPY --from=build ["/usr/local/bin/opticsd", \
"/usr/bin/"]
ENTRYPOINT ["/usr/bin/opticsd"]