-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
61 lines (58 loc) · 2.39 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
52
53
54
55
56
57
58
59
60
61
FROM debian:bookworm as builder
WORKDIR /tmp/
RUN set -ex \
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
curl \
libpqxx-dev \
postgresql-server-dev-all \
ca-certificates \
libmicrohttpd-dev \
libssl-dev \
&& curl -L https://github.com/digitalocean/prometheus-client-c/releases/download/v0.1.3/libprom-dev-0.1.3-Linux.deb -o /tmp/libprom-dev-0.1.3-Linux.deb \
&& curl -L https://github.com/digitalocean/prometheus-client-c/releases/download/v0.1.3/libpromhttp-dev-0.1.3-Linux.deb -o /tmp/libpromhttp-dev-0.1.3-Linux.dev \
&& cat /etc/ssl/certs/DigiCert_Global_Root_CA.pem /etc/ssl/certs/DigiCert_Global_Root_G2.pem /etc/ssl/certs/Microsoft_RSA_Root_Certificate_Authority_2017.pem > /postgresql_root.crt \
&& dpkg --install /tmp/libprom-dev-0.1.3-Linux.deb \
&& dpkg --install /tmp/libpromhttp-dev-0.1.3-Linux.dev \
&& git clone --depth 1 --branch 1.3 http://github.com/yandex/odyssey.git \
&& cd odyssey \
&& mkdir build \
&& cd build \
&& cmake -DCMAKE_BUILD_TYPE=Release .. \
&& make \
&& apt-get remove -y build-essential \
cmake \
git \
libpqxx-dev \
postgresql-server-dev-all \
libssl-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
FROM debian:bookworm-slim
ENV CERTFILE='/tmp/tls-cert/tls.crt'
RUN set -ex \
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
libmicrohttpd-dev \
&& curl -L https://github.com/digitalocean/prometheus-client-c/releases/download/v0.1.3/libprom-dev-0.1.3-Linux.deb -o /tmp/libprom-dev-0.1.3-Linux.deb \
&& curl -L https://github.com/digitalocean/prometheus-client-c/releases/download/v0.1.3/libpromhttp-dev-0.1.3-Linux.deb -o /tmp/libpromhttp-dev-0.1.3-Linux.deb \
&& dpkg --install /tmp/libprom-dev-0.1.3-Linux.deb \
&& dpkg --install /tmp/libpromhttp-dev-0.1.3-Linux.deb \
&& rm /tmp/libpromhttp-dev-0.1.3-Linux.deb \
&& rm /tmp/libprom-dev-0.1.3-Linux.deb \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /tmp/odyssey/build/sources/odyssey /usr/local/bin/
COPY --from=builder /postgresql_root.crt /postgresql_root.crt
COPY ./entrypoint.sh .
RUN adduser --disabled-password --gecos '' odyssey
USER odyssey
ENTRYPOINT ["./entrypoint.sh"]
EXPOSE 5432