This repository has been archived by the owner on Jan 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (50 loc) · 1.64 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
FROM ubuntu:focal as builder
ARG ODYSSEY_VERSION=1.1
ENV DEBIAN_FRONTEND noninteractive
WORKDIR /tmp/
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
ca-certificates \
gnupg \
lsb-release \
git
RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
# hadolint ignore=DL3008
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
gcc \
gdb \
libpam0g-dev \
libssl-dev \
postgresql-server-dev-11 \
valgrind \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# hadolint ignore=DL3003
RUN git clone --branch ${ODYSSEY_VERSION} --depth 1 git://github.com/yandex/odyssey.git \
&& cd odyssey \
&& mkdir build \
&& cd build \
&& cmake -DCMAKE_BUILD_TYPE=Release .. \
&& make
WORKDIR /tmp/odyssey
RUN grep -v -E '^(#.*|)$' odyssey.conf > build/sources/odyssey-slim.conf
FROM ubuntu:focal
# hadolint ignore=DL3008
RUN apt-get update && apt-get install -y --no-install-recommends \
libssl1.1 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN groupadd -r odyssey && useradd -r -g odyssey odyssey
COPY --from=builder /tmp/odyssey/build/sources/odyssey /usr/local/bin/
COPY --from=builder /tmp/odyssey/build/sources/odyssey-slim.conf /etc/odyssey/odyssey.conf
COPY docker-entrypoint.sh /entrypoint.sh
RUN chmod a+x /entrypoint.sh
USER odyssey
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 5432
CMD ["odyssey"]