FROM alpine:3.18 AS base ARG install_dir="/app/install" FROM base AS builder RUN build_deps='bash bsd-compat-headers build-base clang cmake coreutils libgit2-dev py3-pytest sqlite-dev valgrind' && \ apk add -q --no-cache $build_deps ARG COMPILER=clang ARG CONFIGURATION=Release ARG DEFAULT_HOST=127.0.0.1 ARG src_dir="/app/src" ARG install_dir COPY [".", "$src_dir"] RUN cd -- "$src_dir" && \ make install \ "COMPILER=$COMPILER" \ "CONFIGURATION=$CONFIGURATION" \ "DEFAULT_HOST=$DEFAULT_HOST" \ "INSTALL_PREFIX=$install_dir" && \ ulimit -n 1024 && \ make test/all CONFIGURATION="$CONFIGURATION" FROM base LABEL maintainer="Egor Tensin " RUN runtime_deps='tini libgit2 sqlite-dev' && \ apk add -q --no-cache $runtime_deps ARG install_dir COPY --from=builder ["$install_dir", "$install_dir"] ENV PATH="$install_dir/bin:${PATH}" WORKDIR "$install_dir/bin" ENTRYPOINT ["/sbin/tini", "--"] CMD ["cimple-server"]