-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
94 lines (72 loc) · 2.7 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
ARG PG_VERSION=latest
FROM postgres:$PG_VERSION as builder
ARG WAL_G_VERSION
ARG PG_ACOUSTID_VERSION
ARG PATRONI_VERSION
RUN apt-get update && \
apt-get install -y \
python3 \
python3-venv \
python3-yaml \
python3-requests \
python3-psycopg2 \
libpq-dev \
git \
wget \
make \
gcc \
postgresql-server-dev-$PG_MAJOR
RUN python3 -m venv --system-site-packages /opt/patroni
RUN /opt/patroni/bin/pip install "patroni[kubernetes]==$PATRONI_VERSION"
RUN python3 -m venv --system-site-packages /opt/yacron
RUN /opt/yacron/bin/pip install yacron
RUN git clone -b v${PG_ACOUSTID_VERSION} https://github.com/acoustid/pg_acoustid.git /opt/pg_acoustid && \
cd /opt/pg_acoustid && \
make && \
make install
RUN mkdir -p /opt/wal-g/bin && \
cd /opt/wal-g/bin && \
wget https://github.com/wal-g/wal-g/releases/download/v$WAL_G_VERSION/wal-g-pg-ubuntu-20.04-amd64.tar.gz && \
tar xvf wal-g-pg-ubuntu-20.04-amd64.tar.gz && \
mv wal-g-pg-ubuntu-20.04-amd64 wal-g && \
rm *.tar.gz
FROM postgres:$PG_VERSION
RUN apt-get update && \
apt-get install -y \
python3 \
python3-venv \
python3-yaml \
python3-requests \
python3-psycopg2 \
pgbackrest \
barman \
dumb-init \
curl \
daemontools \
liblz4-tool \
less \
vim \
lzop \
sshpass \
pv \
gettext-base
ARG CITUS_VERSION
# RUN curl https://install.citusdata.com/community/deb.sh | bash && \
# apt-get install -y postgresql-$PG_MAJOR-citus-$CITUS_VERSION
COPY setup_db.sh /docker-entrypoint-initdb.d/setup_db.sh
COPY psql pg_dump pg_dumpall wal-g /usr/local/bin/
COPY scripts/ /postgresql-scripts/
COPY --from=builder /usr/lib/postgresql/$PG_MAJOR/lib/acoustid.so /usr/lib/postgresql/$PG_MAJOR/lib/
COPY --from=builder /usr/share/postgresql/$PG_MAJOR/extension/acoustid* /usr/share/postgresql/$PG_MAJOR/extension/
COPY --from=builder /usr/lib/postgresql/$PG_MAJOR/lib/bitcode/acoustid /usr/lib/postgresql/$PG_MAJOR/lib/bitcode/
COPY --from=builder /opt/wal-g/ /opt/wal-g/
COPY --from=builder /opt/patroni/ /opt/patroni/
RUN ln -s /opt/patroni/bin/patroni /usr/local/bin && \
ln -s /opt/patroni/bin/patronictl /usr/local/bin
COPY --from=builder /opt/yacron/ /opt/yacron/
RUN ln -s /opt/yacron/bin/yacron /usr/local/bin
RUN curl -L https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o /usr/local/bin/yq && \
chmod +x /usr/local/bin/yq
ARG DBMATE_VERSION
RUN curl -fsSL -o /usr/local/bin/dbmate https://github.com/amacneil/dbmate/releases/download/v$DBMATE_VERSION/dbmate-linux-amd64 && \
chmod +x /usr/local/bin/dbmate