Skip to content

Commit c18290d

Browse files
committed
Merge branch '8-support-postgres-14' into 'master'
feat: support PostgreSQL 14 (#8) Closes #8 See merge request postgres-ai/custom-images!34
2 parents de71d2d + 5096c8b commit c18290d

File tree

3 files changed

+81
-56
lines changed

3 files changed

+81
-56
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Storage-optimized: the size of each image is just ~120 MiB.
1010
Use these images with Database Lab, when you need HypoPG or anything else.
1111

1212
### What's inside
13-
Available PostgreSQL versions: 9.6, 10, 11, 12, 13. Extensions:
13+
Available PostgreSQL versions: 9.6, 10, 11, 12, 13, 14. Extensions:
1414
- all official ["core" contrib modules](https://www.postgresql.org/docs/current/contrib.html)
1515
- [bg_mon](https://github.com/CyberDem0n/bg_mon)
1616
- [Citus](https://github.com/citusdata/citus)
@@ -35,13 +35,15 @@ Available PostgreSQL versions: 9.6, 10, 11, 12, 13. Extensions:
3535

3636
#### Not included in the PostgreSQL 13 image (yet)
3737
The PostgreSQL 13 image is now missing the following extensions (they will be added in the future):
38-
- hll
39-
- topn
40-
- citus
41-
- hypopg
38+
- bg_mon
39+
- pg_auth_mon
40+
- powa
41+
42+
#### Not included in the PostgreSQL 14 image (yet)
43+
The PostgreSQL 14 image is now missing the following extensions (they will be added in the future):
44+
- bg_mon
4245
- pg_auth_mon
4346
- pg_hint_plan
44-
- pgaudit
4547
- powa
4648
- timescaledb
4749

@@ -103,7 +105,7 @@ The PostgreSQL 13 image is now missing the following extensions (they will be ad
103105
| powa | 4.0.1 | PostgreSQL Workload Analyser-core |
104106
| refint | 1.0 | functions for implementing referential integrity (obsolete) |
105107
| seg | 1.3 | data type for representing line segments or floating-point intervals |
106-
| set_user | 2.0 | similar to SET ROLE but with added logging |
108+
| set_user | 3.0 | similar to SET ROLE but with added logging |
107109
| sslinfo | 1.2 | information about SSL certificates |
108110
| tablefunc | 1.0 | functions that manipulate whole tables, including crosstab |
109111
| tcn | 1.0 | Triggered change notifications |

extended-postgres/Dockerfile

Lines changed: 56 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,76 @@
1-
ARG PG_SERVER_VERSION=12
1+
ARG PG_SERVER_VERSION=14
22

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

66
ARG PG_SERVER_VERSION
7-
ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-12}
7+
ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-14}
88

99
ARG WALG_VERSION
1010
ENV WALG_VERSION=${WALG_VERSION:-0.2.19}
1111

12-
ENV CITUS_VERSION=9.4
13-
1412
RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
1513
&& apt-get update -o Acquire::CompressionTypes::Order::=gz \
1614
&& apt-get install --no-install-recommends -y wget make gcc unzip sudo git \
1715
curl libc6-dev apt-transport-https ca-certificates pgxnclient bc \
1816
build-essential libevent-dev libssl-dev krb5-multidev libkrb5-dev lsb-release apt-utils \
1917
&& apt-get install --no-install-recommends -y \
2018
postgresql-server-dev-${PG_SERVER_VERSION} \
21-
&& apt-get install --no-install-recommends -y \
22-
postgresql-${PG_SERVER_VERSION}-repack \
19+
&& apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-repack \
2320
&& apt-get install --no-install-recommends -y \
2421
postgresql-plpython3-${PG_SERVER_VERSION} \
25-
# extensions supported in PostgreSQL 12 and below
26-
# bc is used to manage PostgreSQL versions with dot like 9.6
27-
&& if [ $(echo "$PG_SERVER_VERSION < 13" | /usr/bin/bc) = "1" ]; then \
2822
# hypopg
29-
apt-get install --no-install-recommends -y \
23+
&& apt-get install --no-install-recommends -y \
3024
postgresql-${PG_SERVER_VERSION}-hypopg \
31-
&& apt-get install --no-install-recommends -y \
25+
&& apt-get install --no-install-recommends -y \
3226
postgresql-${PG_SERVER_VERSION}-hypopg-dbgsym \
33-
# pg_hint_plan extension (dots are to be skipped here, e.g., "9.6" -> "96")
34-
&& export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\.//') \
35-
&& wget --quiet -O /tmp/pg_hint_plan.zip \
36-
https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \
37-
&& unzip /tmp/pg_hint_plan.zip -d /tmp \
38-
&& cd /tmp/pg_hint_plan-PG${PG_PLAN_HINT_VERSION} \
39-
&& make && make install \
40-
# timescaledb extension
41-
&& if [ $(echo "$PG_SERVER_VERSION < 11" | /usr/bin/bc) = "1" ]; then \
42-
echo 'deb https://packagecloud.io/timescale/timescaledb/debian/' \
43-
$(env -i bash -c '. /etc/os-release; echo ${VERSION_CODENAME}') \
44-
'main' > /etc/apt/sources.list.d/timescaledb.list \
45-
&& wget --quiet -O - \
46-
https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \
47-
&& apt-get update \
48-
&& apt-get install -y timescaledb-postgresql-${PG_SERVER_VERSION}; \
49-
else \
50-
echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/timescaledb.list \
51-
&& wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \
52-
&& apt-get update \
53-
&& apt install -y timescaledb-2-postgresql-${PG_SERVER_VERSION}; \
54-
fi \
55-
# powa extension
56-
&& apt-get install postgresql-${PG_SERVER_VERSION}-powa \
57-
# pgaudit extension
58-
&& apt-get install postgresql-${PG_SERVER_VERSION}-pgaudit \
59-
# pg_auth_mon extension
60-
&& git clone https://github.com/RafiaSabih/pg_auth_mon.git \
61-
&& cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \
62-
fi \
63-
# citus extension; only Postgres 11 and 12 are supported by citus
64-
&& if [ "${PG_SERVER_VERSION}" = "12" ] || [ "${PG_SERVER_VERSION}" = "11" ]; then \
27+
# pgaudit extension
28+
&& apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pgaudit \
29+
&& if [ $(echo "$PG_SERVER_VERSION < 14" | /usr/bin/bc) = "1" ]; then \
30+
# pg_hint_plan extension (dots are to be skipped here, e.g., "9.6" -> "96")
31+
export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\.//') \
32+
&& wget --quiet -O /tmp/pg_hint_plan.zip \
33+
https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \
34+
&& unzip /tmp/pg_hint_plan.zip -d /tmp \
35+
&& cd /tmp/pg_hint_plan-PG${PG_PLAN_HINT_VERSION} \
36+
&& make && make install; \
37+
fi \
38+
# extensions supported in PostgreSQL 12 and below
39+
# bc is used to manage PostgreSQL versions with dot like 9.6
40+
&& if [ $(echo "$PG_SERVER_VERSION < 13" | /usr/bin/bc) = "1" ]; then \
41+
# powa extension
42+
apt-get install postgresql-${PG_SERVER_VERSION}-powa \
43+
# pg_auth_mon extension
44+
&& git clone https://github.com/RafiaSabih/pg_auth_mon.git \
45+
&& cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \
46+
fi \
47+
# timescaledb extension
48+
&& if [ $(echo "$PG_SERVER_VERSION < 11" | /usr/bin/bc) = "1" ]; then \
49+
echo 'deb https://packagecloud.io/timescale/timescaledb/debian/' \
50+
$(env -i bash -c '. /etc/os-release; echo ${VERSION_CODENAME}') \
51+
'main' > /etc/apt/sources.list.d/timescaledb.list \
52+
&& wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \
53+
&& apt-get update \
54+
&& apt-get install -y timescaledb-postgresql-${PG_SERVER_VERSION}; \
55+
elif [ $(echo "$PG_SERVER_VERSION < 14" | /usr/bin/bc) = "1" ]; then \
56+
echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/timescaledb.list \
57+
&& wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \
58+
&& apt-get update \
59+
&& apt install -y timescaledb-2-postgresql-${PG_SERVER_VERSION}; \
60+
fi \
61+
# citus extension; only versions Postgres 11+ are supported
62+
&& if [ "${PG_SERVER_VERSION}" = "11" ]; then \
6563
curl -s https://install.citusdata.com/community/deb.sh | bash \
66-
&& apt-get install -y postgresql-${PG_SERVER_VERSION}-citus-${CITUS_VERSION} \
64+
&& apt-get install -y postgresql-${PG_SERVER_VERSION}-citus-9.4 \
6765
postgresql-${PG_SERVER_VERSION}-hll=2.14.citus-1 \
6866
postgresql-${PG_SERVER_VERSION}-topn=2.3.0; \
6967
fi \
68+
&& if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ]; then \
69+
curl -s https://install.citusdata.com/community/deb.sh | bash \
70+
&& apt-get install -y postgresql-${PG_SERVER_VERSION}-citus-10.2 \
71+
postgresql-${PG_SERVER_VERSION}-hll=2.16.citus-1 \
72+
postgresql-${PG_SERVER_VERSION}-topn=2.4.0; \
73+
fi \
7074
# pg_timetable extension
7175
&& wget https://github.com/cybertec-postgresql/pg_timetable/releases/download/v2.3.0/pg_timetable_2.3.0_Linux_x86_64.deb \
7276
&& dpkg -i pg_timetable_2.3.0_Linux_x86_64.deb \
@@ -83,14 +87,17 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
8387
&& apt-get install postgresql-${PG_SERVER_VERSION}-pg-stat-kcache \
8488
# add pg_qualstats extension
8589
&& apt-get install postgresql-${PG_SERVER_VERSION}-pg-qualstats \
86-
# pg_mon extension
87-
&& git clone https://github.com/CyberDem0n/bg_mon.git && cd bg_mon \
88-
&& USE_PGXS=1 make && USE_PGXS=1 make install \
90+
&& if [ $(echo "$PG_SERVER_VERSION < 12" | /usr/bin/bc) = "1" ]; then \
91+
# bg_mon extension
92+
apt-get install -yq --no-install-suggests --no-install-recommends brotli \
93+
&& git clone https://github.com/CyberDem0n/bg_mon.git && cd bg_mon \
94+
&& USE_PGXS=1 make && USE_PGXS=1 make install && cd .. ; \
95+
fi \
8996
# pgextwlist extension
9097
&& apt-get install postgresql-${PG_SERVER_VERSION}-pgextwlist \
9198
# set_user extension
9299
&& git clone https://github.com/pgaudit/set_user.git \
93-
&& cd set_user && git checkout REL2_0_0 && make USE_PGXS=1 && make USE_PGXS=1 install \
100+
&& cd set_user && git checkout REL3_0_0 && make USE_PGXS=1 && make USE_PGXS=1 install \
94101
# errorlogs extension
95102
&& if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \
96103
cd /tmp && wget https://github.com/munakoiso/logerrors/archive/v2.0.tar.gz \
@@ -105,7 +112,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
105112
make wget unzip curl libc6-dev apt-transport-https git \
106113
postgresql-server-dev-${PG_SERVER_VERSION} pgxnclient build-essential \
107114
libssl-dev krb5-multidev comerr-dev krb5-multidev libkrb5-dev apt-utils lsb-release \
108-
libgssrpc4 libkadm5clnt-mit11 libkadm5srv-mit11 \
115+
libgssrpc4 \
109116
&& apt-get clean -y autoclean \
110117
&& rm -rf /var/lib/apt/lists/* \
111118
# remove standard pgdata

extended-postgres/build-images-ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ build-extended-postgres-13-image-latest:
8686
PG_SERVER_VERSION: "13"
8787
TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_TAG}"
8888

89+
build-extended-postgres-14-image-latest:
90+
<<: *build_image_definition_dh
91+
<<: *only_tag_release
92+
variables:
93+
<<: *extended_image_vars_dh
94+
PG_SERVER_VERSION: "14"
95+
TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_TAG}"
96+
8997
build-extended-postgres-9-6-image-feature:
9098
<<: *build_image_definition_gl
9199
<<: *only_feature
@@ -125,3 +133,11 @@ build-extended-postgres-13-image-feature:
125133
<<: *extended_image_vars_gl
126134
PG_SERVER_VERSION: "13"
127135
TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_REF_SLUG}"
136+
137+
build-extended-postgres-14-image-feature:
138+
<<: *build_image_definition_gl
139+
<<: *only_feature
140+
variables:
141+
<<: *extended_image_vars_gl
142+
PG_SERVER_VERSION: "14"
143+
TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_REF_SLUG}"

0 commit comments

Comments
 (0)