@@ -6,6 +6,9 @@ LABEL maintainer="postgres.ai"
6
6
ARG PG_SERVER_VERSION
7
7
ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-12}
8
8
9
+ ARG WALG_VERSION
10
+ ENV WALG_VERSION=${WALG_VERSION:-0.2.19}
11
+
9
12
ENV CITUS_VERSION=9.4
10
13
11
14
RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
@@ -17,9 +20,9 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
17
20
postgresql-server-dev-${PG_SERVER_VERSION} \
18
21
&& apt-get install --no-install-recommends -y \
19
22
postgresql-${PG_SERVER_VERSION}-repack \
20
- && apt-get install --no-install-recommends -y \
23
+ && apt-get install --no-install-recommends -y \
21
24
postgresql-plpython3-${PG_SERVER_VERSION} \
22
- # extensions supported in PostgreSQL 12 and below
25
+ # extensions supported in PostgreSQL 12 and below
23
26
# bc is used to manage PostgreSQL versions with dot like 9.6
24
27
&& if [ $(echo "$PG_SERVER_VERSION < 13" | /usr/bin/bc) = "1" ]; then \
25
28
# hypopg
@@ -81,6 +84,9 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
81
84
# set_user extension
82
85
&& git clone https://github.com/pgaudit/set_user.git \
83
86
&& cd set_user && make USE_PGXS=1 && make USE_PGXS=1 install \
87
+ # WAL-G
88
+ && wget --quiet -O /tmp/wal-g.linux-amd64.tar.gz "https://github.com/wal-g/wal-g/releases/download/v${WALG_VERSION}/wal-g.linux-amd64.tar.gz" \
89
+ && tar -zxvf /tmp/wal-g.linux-amd64.tar.gz && mv wal-g /usr/local/bin/ \
84
90
# remove all auxilary packages to reduce final image size
85
91
&& cd / && rm -rf /tmp/* && apt-get purge -y --auto-remove gcc \
86
92
make wget unzip curl libc6-dev apt-transport-https git \
@@ -96,9 +102,9 @@ EXPOSE 5432
96
102
97
103
# Prepare Postgres start script
98
104
RUN echo "#!/bin/bash" > /pg_start.sh && chmod a+x /pg_start.sh \
99
- && echo "chown -R postgres:postgres /var/lib/postgresql/pgdata /var/run/postgresql" \
105
+ && echo "chown -R postgres:postgres \$ {PGDATA} /var/run/postgresql" \
100
106
>> /pg_start.sh \
101
- && printf "sudo -u postgres /usr/lib/postgresql/${PG_SERVER_VERSION}/bin/postgres -D /var/lib/postgresql/pgdata \n " \
107
+ && printf "sudo -Eu postgres /usr/lib/postgresql/${PG_SERVER_VERSION}/bin/postgres -D \$ {PGDATA} >& /proc/1/fd/1 \n " \
102
108
>> /pg_start.sh \
103
109
# Infinite sleep to allow restarting Postgres
104
110
&& echo "/bin/bash -c \" trap : TERM INT; sleep infinity & wait\" " \
0 commit comments