Skip to content

Commit

Permalink
add dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
berthubert committed Mar 13, 2024
1 parent e2e4c7c commit f836261
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM scratch
ADD build/simplomon simplomon

ADD certs.tar /
ENTRYPOINT ["/simplomon"]
35 changes: 35 additions & 0 deletions Dockerfile.full-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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
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
ADD certs.tar /
COPY --from=builder /project/build/simplomon simplomon
VOLUME /config

ENTRYPOINT ["/simplomon"]

0 comments on commit f836261

Please sign in to comment.