-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile.full-build
41 lines (35 loc) · 1.26 KB
/
Dockerfile.full-build
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
FROM debian:bookworm AS builder
RUN apt-get update -yqq && apt-get install -yqq \
build-essential \
git \
meson \
nlohmann-json3-dev \
libnghttp2-dev \
liblua5.3-dev \
pkg-config \
cmake \
openssl \
libssl-dev \
zlib1g-dev \
xxd \
libsqlite3-dev
COPY . /src
WORKDIR /src
# we want to build cleanly so we ask meson to generate a tarball of the project
RUN rm -rf build/ && meson setup build && meson dist -C build --allow-dirty --no-tests
RUN mkdir /project
WORKDIR /project
# extract the tarball meson made for us and move the content up to where we are
RUN tar xf /src/build/meson-dist/simplomon-*.tar.xz && mv simplomon-*/* .
RUN LDFLAGS=-static meson setup build --prefer-static -Dbuildtype=release
RUN meson compile -C build/
RUN strip build/simplomon
#RUN tar cvhf certs.tar /etc/ssl/certs/ca-certificates.crt /usr/lib/ssl/openssl.cnf /usr/lib/ssl/certs/*
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /usr/lib/ssl/openssl.cnf /usr/lib/ssl/openssl.cnf
COPY --from=builder /usr/lib/ssl/certs/* /usr/lib/ssl/certs/
COPY --from=builder /project/build/simplomon simplomon
COPY --from=builder /project/html html
VOLUME /config
ENTRYPOINT ["/simplomon"]