-
Notifications
You must be signed in to change notification settings - Fork 45
/
Dockerfile
51 lines (37 loc) · 1.21 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
FROM ubuntu:20.04 AS run-dependencies
# We make an effort here to shrink the resulting image by dropping all the
# static libraries. It would probably be better not to install any of these
# libraries and build a static standardese binary.
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive TZ=UTC apt-get install -y \
libboost-program-options1.71 \
libboost-filesystem1.71 \
libclang-dev \
clang \
&& rm -rf /var/lib/apt/lists/* \
&& find /usr/lib -name '*.a' -exec rm \{\} \;
FROM ubuntu:20.04 AS build-dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive TZ=UTC apt-get install -y \
libclang-dev \
clang \
git \
llvm-dev \
cmake \
python3 \
libboost-program-options-dev \
libboost-filesystem-dev \
&& rm -rf /var/lib/apt/lists/*
FROM build-dependencies AS built
ARG NUM_THREADS=1
COPY . /src
RUN mkdir /build
WORKDIR /build
RUN cmake -DBUILD_SHARED_LIBS=OFF ../src
RUN cmake --build . --target standardese_tool -j $NUM_THREADS
FROM run-dependencies AS standardese
RUN useradd -ms /bin/bash standardese
COPY --from=built /build/tool/standardese /usr/local/bin/standardese
USER standardese
WORKDIR /home/standardese
RUN standardese --version