Skip to content

Commit da5219c

Browse files
committed
Postgres 12 is default; cleanup; polish comments
1 parent 92462b3 commit da5219c

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

extended/Dockerfile

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
ARG PG_SERVER_VERSION=11
1+
ARG PG_SERVER_VERSION=12
22

33
FROM postgres:${PG_SERVER_VERSION}
44
LABEL maintainer="postgres.ai"
55

6-
76
ARG PG_SERVER_VERSION
87
ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-12}
8+
99
ENV CITUS_VERSION=9.4
1010

1111
RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
@@ -20,25 +20,24 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
2020
&& apt-get install --no-install-recommends -y \
2121
postgresql-${PG_SERVER_VERSION}-hypopg \
2222
&& apt-get install --no-install-recommends -y \
23-
postgresql-${PG_SERVER_VERSION}-hypopg-dbgsym \
24-
# pg_hint_plan extension (convert versions with dot "9.6" to "96")
23+
postgresql-${PG_SERVER_VERSION}-hypopg-dbgsym \
24+
# pg_hint_plan extension (dots are to be skipped here, e.g., "9.6" -> "96")
2525
&& export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\.//') \
2626
&& wget --quiet -O /tmp/pg_hint_plan.zip \
2727
https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \
2828
&& unzip /tmp/pg_hint_plan.zip -d /tmp \
2929
&& cd /tmp/pg_hint_plan-PG${PG_PLAN_HINT_VERSION} \
3030
&& make && make install \
3131
# timescaledb extension
32-
&& echo 'deb https://packagecloud.io/timescale/timescaledb/debian/' \
33-
$(env -i bash -c '. /etc/os-release; echo ${VERSION_CODENAME}') \
32+
&& echo 'deb https://packagecloud.io/timescale/timescaledb/debian/' \
33+
$(env -i bash -c '. /etc/os-release; echo ${VERSION_CODENAME}') \
3434
'main' > /etc/apt/sources.list.d/timescaledb.list \
3535
&& wget --quiet -O - \
3636
https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \
3737
&& apt-get update \
3838
&& apt-get install -y timescaledb-postgresql-${PG_SERVER_VERSION} \
39-
# citus extension. 11 and 12 versions only are supported by citus
39+
# citus extension; only Postgres 11 and 12 are supported by citus
4040
&& if [ "${PG_SERVER_VERSION}" = "12" ] || [ "${PG_SERVER_VERSION}" = "11" ]; then \
41-
# only 11 and 12 versions are supported by citus
4241
curl -s https://install.citusdata.com/community/deb.sh | bash \
4342
&& apt-get install -y postgresql-${PG_SERVER_VERSION}-citus-${CITUS_VERSION} \
4443
postgresql-${PG_SERVER_VERSION}-hll=2.14.citus-1 \
@@ -56,21 +55,21 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
5655
&& export USE_PGXS=1 && make && make install && cd .. && rm -rf pg_show_plans \
5756
# pg_cron extension
5857
&& apt-get install -y postgresql-${PG_SERVER_VERSION}-cron \
59-
# postgresql_anonymizer extension
58+
# postgresql_anonymizer extension
6059
&& pgxn install ddlx && pgxn install postgresql_anonymizer \
6160
# pg_stat_kcache extension
6261
&& apt-get install postgresql-${PG_SERVER_VERSION}-pg-stat-kcache \
6362
# add pg_qualstats extension
6463
&& apt-get install postgresql-${PG_SERVER_VERSION}-pg-qualstats \
6564
# pg_mon extension
66-
&& git clone https://github.com/CyberDem0n/bg_mon.git && cd bg_mon \
65+
&& git clone https://github.com/CyberDem0n/bg_mon.git && cd bg_mon \
6766
&& USE_PGXS=1 make && USE_PGXS=1 make install \
6867
# pgextwlist extension
6968
&& apt-get install postgresql-${PG_SERVER_VERSION}-pgextwlist \
7069
# pg_auth_mon extension
7170
&& git clone https://github.com/RafiaSabih/pg_auth_mon.git \
7271
&& cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install \
73-
# set_user extension
72+
# set_user extension
7473
&& git clone https://github.com/pgaudit/set_user.git \
7574
&& cd set_user && make USE_PGXS=1 && make USE_PGXS=1 install \
7675
# remove all auxilary packages to reduce final image size
@@ -81,18 +80,18 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
8180
libgssrpc4 libkadm5clnt-mit11 libkadm5srv-mit11 \
8281
&& apt-get clean -y autoclean \
8382
&& rm -rf /var/lib/apt/lists/* \
84-
# remove standard pgdata
85-
&& rm -rf /var/lib/postgresql/${PG_SERVER_VERSION}/
83+
# remove standard pgdata
84+
&& rm -rf /var/lib/postgresql/${PG_SERVER_VERSION}/
8685

8786
EXPOSE 5432
8887

89-
# Prepare Postgres start script.
88+
# Prepare Postgres start script
9089
RUN echo "#!/bin/bash" > /pg_start.sh && chmod a+x /pg_start.sh \
9190
&& echo "chown -R postgres:postgres /var/lib/postgresql/pgdata /var/run/postgresql" \
9291
>> /pg_start.sh \
9392
&& printf "sudo -u postgres /usr/lib/postgresql/${PG_SERVER_VERSION}/bin/postgres -D /var/lib/postgresql/pgdata \n" \
9493
>> /pg_start.sh \
95-
# Infinite sleep to allow restarting Postgres.
94+
# Infinite sleep to allow restarting Postgres
9695
&& echo "/bin/bash -c \"trap : TERM INT; sleep infinity & wait\"" \
9796
>> /pg_start.sh
9897

0 commit comments

Comments
 (0)