Skip to content

Commit 5cb0594

Browse files
committed
Merge branch 'postgres_13_support' into 'master'
added support of Postgres 13 in Dockerfile based on it can be build extended image based on Postgres 13 ``` sudo docker build --build-arg PG_SERVER_VERSION=13 -t postgres-extended-13 . ``` For PostgreSQL in comparison with Postgres 11 and 12 we don't have following extensions: 1. removed in base image of Postgres 13 * hll * timetravel * topn 2. don't support 13 yet (expect soon): * citus * hypopg * pg_auth_mon * pg_hint_plan * powa * timescaledb related https://gitlab.com/postgres-ai/custom-images/-/issues/2 See merge request postgres-ai/custom-images!17
2 parents 18ae950 + d710754 commit 5cb0594

File tree

1 file changed

+27
-22
lines changed

1 file changed

+27
-22
lines changed

extended/Dockerfile

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,48 @@ ENV CITUS_VERSION=9.4
1111
RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
1212
&& apt-get update -o Acquire::CompressionTypes::Order::=gz \
1313
&& apt-get install --no-install-recommends -y wget make gcc unzip sudo git \
14-
curl libc6-dev apt-transport-https ca-certificates pgxnclient \
14+
curl libc6-dev apt-transport-https ca-certificates pgxnclient bc \
1515
build-essential libevent-dev libssl-dev krb5-multidev \
1616
&& apt-get install --no-install-recommends -y \
1717
postgresql-server-dev-${PG_SERVER_VERSION} \
1818
&& apt-get install --no-install-recommends -y \
1919
postgresql-${PG_SERVER_VERSION}-repack \
20-
&& apt-get install --no-install-recommends -y \
21-
postgresql-${PG_SERVER_VERSION}-hypopg \
22-
&& apt-get install --no-install-recommends -y \
23-
postgresql-${PG_SERVER_VERSION}-hypopg-dbgsym \
24-
# pg_hint_plan extension (dots are to be skipped here, e.g., "9.6" -> "96")
25-
&& export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\.//') \
26-
&& wget --quiet -O /tmp/pg_hint_plan.zip \
20+
# extensions supported in PostgreSQL 12 and below
21+
# bc is used to manage PostgreSQL versions with dot like 9.6
22+
&& if [ $(echo "$PG_SERVER_VERSION < 13" | /usr/bin/bc) = "1" ]; then \
23+
# hypopg
24+
apt-get install --no-install-recommends -y \
25+
postgresql-${PG_SERVER_VERSION}-hypopg \
26+
&& apt-get install --no-install-recommends -y \
27+
postgresql-${PG_SERVER_VERSION}-hypopg-dbgsym \
28+
# pg_hint_plan extension (dots are to be skipped here, e.g., "9.6" -> "96")
29+
&& export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\.//') \
30+
&& wget --quiet -O /tmp/pg_hint_plan.zip \
2731
https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \
28-
&& unzip /tmp/pg_hint_plan.zip -d /tmp \
32+
&& unzip /tmp/pg_hint_plan.zip -d /tmp \
2933
&& cd /tmp/pg_hint_plan-PG${PG_PLAN_HINT_VERSION} \
30-
&& make && make install \
31-
# timescaledb extension
32-
&& echo 'deb https://packagecloud.io/timescale/timescaledb/debian/' \
33-
$(env -i bash -c '. /etc/os-release; echo ${VERSION_CODENAME}') \
34-
'main' > /etc/apt/sources.list.d/timescaledb.list \
35-
&& wget --quiet -O - \
34+
&& make && make install \
35+
# timescaledb extension
36+
&& echo 'deb https://packagecloud.io/timescale/timescaledb/debian/' \
37+
$(env -i bash -c '. /etc/os-release; echo ${VERSION_CODENAME}') \
38+
'main' > /etc/apt/sources.list.d/timescaledb.list \
39+
&& wget --quiet -O - \
3640
https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \
37-
&& apt-get update \
38-
&& apt-get install -y timescaledb-postgresql-${PG_SERVER_VERSION} \
41+
&& apt-get update \
42+
&& apt-get install -y timescaledb-postgresql-${PG_SERVER_VERSION} \
43+
# powa extension
44+
&& apt-get install postgresql-${PG_SERVER_VERSION}-powa \
45+
# pg_auth_mon extension
46+
&& git clone https://github.com/RafiaSabih/pg_auth_mon.git \
47+
&& cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \
48+
fi \
3949
# citus extension; only Postgres 11 and 12 are supported by citus
4050
&& if [ "${PG_SERVER_VERSION}" = "12" ] || [ "${PG_SERVER_VERSION}" = "11" ]; then \
4151
curl -s https://install.citusdata.com/community/deb.sh | bash \
4252
&& apt-get install -y postgresql-${PG_SERVER_VERSION}-citus-${CITUS_VERSION} \
4353
postgresql-${PG_SERVER_VERSION}-hll=2.14.citus-1 \
4454
postgresql-${PG_SERVER_VERSION}-topn=2.3.0; \
4555
fi \
46-
# powa extension
47-
&& apt-get install postgresql-${PG_SERVER_VERSION}-powa \
4856
# pg_timetable extension
4957
&& wget https://github.com/cybertec-postgresql/pg_timetable/releases/download/v2.3.0/pg_timetable_2.3.0_Linux_x86_64.deb \
5058
&& dpkg -i pg_timetable_2.3.0_Linux_x86_64.deb \
@@ -66,9 +74,6 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
6674
&& USE_PGXS=1 make && USE_PGXS=1 make install \
6775
# pgextwlist extension
6876
&& apt-get install postgresql-${PG_SERVER_VERSION}-pgextwlist \
69-
# pg_auth_mon extension
70-
&& git clone https://github.com/RafiaSabih/pg_auth_mon.git \
71-
&& cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install \
7277
# set_user extension
7378
&& git clone https://github.com/pgaudit/set_user.git \
7479
&& cd set_user && make USE_PGXS=1 && make USE_PGXS=1 install \

0 commit comments

Comments
 (0)