aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Dockerfile
blob: 995f4a21424e74fd3432e77eff63155e8d87f05e (plain) (blame)
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 alpine:3.17 AS base

ARG install_dir="/app/install"

FROM base AS builder

RUN apk add -q --no-cache bash bsd-compat-headers build-base clang cmake libgit2-dev python3 sqlite-dev

ARG C_COMPILER=clang
ARG BUILD_TYPE=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 \
        "C_COMPILER=$C_COMPILER" \
        "BUILD_TYPE=$BUILD_TYPE" \
        "DEFAULT_HOST=$DEFAULT_HOST" \
        "INSTALL_PREFIX=$install_dir"

FROM base

LABEL maintainer="Egor Tensin <Egor.Tensin@gmail.com>"

RUN apk add -q --no-cache tini libgit2 sqlite-dev

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"]