Skip to content

Commit 7c1d45f

Browse files
committed
Merge branch 'postgres-17' into 'master'
Add PostgreSQL 17rc1 image See merge request postgres-ai/custom-images!66
2 parents de12470 + ce94954 commit 7c1d45f

File tree

3 files changed

+61
-38
lines changed

3 files changed

+61
-38
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Storage-optimized: the size of each image is ~300-500 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 (EOL), 10 (EOL), 11, 12, 13, 14, 15, 16. Extensions:
13+
Available PostgreSQL versions: 9.6 (EOL), 10 (EOL), 11 (EOL), 12, 13, 14, 15, 16, 17. 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,10 +35,14 @@ Available PostgreSQL versions: 9.6 (EOL), 10 (EOL), 11, 12, 13, 14, 15, 16. Exte
3535
- [timescaledb](https://github.com/timescale/timescaledb)
3636
- [pgvector](https://github.com/pgvector/pgvector)
3737

38-
#### Not included in the PostgreSQL 16 image (yet)
39-
The PostgreSQL 16 image is now missing the following extensions (they will be added in the future):
40-
- pg_auth_mon
41-
- set_user
38+
#### Not included in the PostgreSQL 17 image (yet)
39+
The PostgreSQL 17 image is now missing the following extensions (they will be added in the future):
40+
- pg_repack
41+
- powa
42+
- timescaledb
43+
- citus
44+
- topn
45+
- pg_qualstats
4246

4347
### How to extend
4448
- You can fork this repository and extend `Dockerfile`, then build your own images

extended-postgres/Dockerfile

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ ENV WALG_VERSION=${WALG_VERSION:-3.0.3}
2323
ARG PG_TIMETABLE_VERSION
2424
ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-5.9.0}
2525

26-
ARG SET_USER_VERSION
27-
ENV SET_USER_VERSION=${SET_USER_VERSION:-REL4_1_0}
28-
2926
ARG LOGERRORS_VERSION
3027
ENV LOGERRORS_VERSION=${LOGERRORS_VERSION:-2.1.3}
3128

@@ -43,7 +40,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
4340
&& apt-get update -o Acquire::CompressionTypes::Order::=gz \
4441
&& apt-get install --no-install-recommends -y wget make gcc unzip sudo git \
4542
curl libc6-dev apt-transport-https ca-certificates pgxnclient bc \
46-
build-essential libssl-dev krb5-multidev libkrb5-dev lsb-release apt-utils \
43+
build-essential libssl-dev krb5-multidev libkrb5-dev lsb-release apt-utils flex \
4744
&& apt-get install --no-install-recommends -y postgresql-server-dev-${PG_SERVER_VERSION} \
4845
# plpython3 (procedural language implementation for Python 3.x)
4946
&& apt-get install --no-install-recommends -y postgresql-plpython3-${PG_SERVER_VERSION} \
@@ -52,36 +49,37 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
5249
apt-get install --no-install-recommends -y postgresql-9.6-amcheck; \
5350
fi \
5451
# pg_repack extension
55-
&& apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-repack \
52+
&& if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \
53+
apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-repack; \
54+
fi \
5655
# hypopg extension
5756
&& apt-get install --no-install-recommends -y \
5857
postgresql-${PG_SERVER_VERSION}-hypopg \
5958
postgresql-${PG_SERVER_VERSION}-hypopg-dbgsym \
6059
# pgaudit extension
6160
&& apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pgaudit \
6261
# pg_hint_plan extension
63-
&& if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \
62+
&& if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \
63+
apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-hint-plan; \
64+
else \
6465
export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\.//') \
65-
&& wget --quiet -O /tmp/pg_hint_plan.zip \
66-
https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \
66+
&& wget --quiet -O /tmp/pg_hint_plan.zip https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \
6767
&& unzip /tmp/pg_hint_plan.zip -d /tmp \
6868
&& cd /tmp/pg_hint_plan-PG${PG_PLAN_HINT_VERSION} \
6969
&& make && make install; \
70-
fi \
70+
fi \
7171
# powa extension
7272
&& if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \
7373
apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-powa; \
7474
fi \
7575
# pg_auth_mon extension
76-
&& if [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \
77-
if [ "${PG_SERVER_VERSION}" = "9.6" ]; then \
78-
cd /tmp && git clone --branch v1.0 --single-branch https://github.com/RafiaSabih/pg_auth_mon.git \
79-
&& cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \
80-
elif [ $(echo "$PG_SERVER_VERSION > 10" | /usr/bin/bc) = "1" ]; then \
81-
cd /tmp && git clone --branch v2.0 --single-branch https://github.com/RafiaSabih/pg_auth_mon.git \
82-
&& cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \
83-
fi \
84-
fi \
76+
&& if [ "${PG_SERVER_VERSION}" = "9.6" ]; then \
77+
cd /tmp && git clone --branch v1.0 --single-branch https://github.com/RafiaSabih/pg_auth_mon.git \
78+
&& cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \
79+
elif [ $(echo "$PG_SERVER_VERSION > 10" | /usr/bin/bc) = "1" ]; then \
80+
cd /tmp && git clone --branch v3.0 --single-branch https://github.com/RafiaSabih/pg_auth_mon.git \
81+
&& cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \
82+
fi \
8583
# timescaledb extension
8684
&& if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \
8785
echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/timescaledb.list \
@@ -105,7 +103,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
105103
# hll extension
106104
&& apt-get install --no-install-recommends -y postgresql-"${PG_SERVER_VERSION}"-hll \
107105
# topn extension
108-
&& if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \
106+
&& if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \
109107
curl -s https://install.citusdata.com/community/deb.sh | bash \
110108
&& apt-get install --no-install-recommends -y postgresql-"${PG_SERVER_VERSION}"-topn; \
111109
fi \
@@ -115,43 +113,48 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
115113
&& rm -rf pg_timetable_Linux_x86_64.deb \
116114
# pg_show_plans extension
117115
&& if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ]; then \
118-
cd /tmp && git clone https://github.com/cybertec-postgresql/pg_show_plans.git \
119-
&& cd pg_show_plans \
120-
&& export USE_PGXS=1 && make && make install; \
116+
apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-show-plans; \
121117
fi \
122118
# pg_cron extension
123119
&& if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \
124120
cd /tmp && git clone --branch v${PG_CRON_VERSION} --single-branch https://github.com/citusdata/pg_cron.git \
125121
&& cd pg_cron \
126122
&& make && make install; \
127-
elif [ "${PG_SERVER_VERSION}" = "9.6" ] || [ "$PG_SERVER_VERSION" = "16" ]; then \
123+
else \
128124
apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-cron; \
129125
fi \
130126
# postgresql_anonymizer extension
131127
&& if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \
132128
pgxn install ddlx && pgxn install postgresql_anonymizer; \
133129
fi \
134130
# pg_stat_kcache extension
135-
&& apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-stat-kcache \
136-
# pg_wait_sampling extension
137131
&& if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \
138-
apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-wait-sampling; \
132+
apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-stat-kcache; \
133+
elif [ $(echo "$PG_SERVER_VERSION == 17" | /usr/bin/bc) = "1" ]; then \
134+
cd /tmp && git clone --branch REL2_3_0 https://github.com/powa-team/pg_stat_kcache.git \
135+
&& cd pg_stat_kcache && make && make install; \
139136
fi \
137+
# pg_wait_sampling extension
138+
&& apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-wait-sampling \
140139
# pg_qualstats extension
141-
&& apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-qualstats \
140+
&& if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \
141+
apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-qualstats; \
142+
fi \
142143
# bg_mon extension
143144
&& apt-get install -y libevent-dev libbrotli-dev \
144145
&& cd /tmp && git clone https://github.com/CyberDem0n/bg_mon.git && cd bg_mon \
145146
&& USE_PGXS=1 make && USE_PGXS=1 make install && cd .. \
146147
# pgextwlist extension
147148
&& apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pgextwlist \
148149
# set_user extension
149-
&& if [ $(echo "$PG_SERVER_VERSION >= 12" | /usr/bin/bc) = "1" ]; then \
150-
cd /tmp && git clone https://github.com/pgaudit/set_user.git \
151-
&& cd set_user && git checkout ${SET_USER_VERSION} && make USE_PGXS=1 && make USE_PGXS=1 install; \
152-
elif [ $(echo "$PG_SERVER_VERSION < 12" | /usr/bin/bc) = "1" ]; then \
153-
cd /tmp && git clone https://github.com/pgaudit/set_user.git \
154-
&& cd set_user && git checkout REL4_0_1 && make USE_PGXS=1 && make USE_PGXS=1 install; \
150+
&& if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \
151+
apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-set-user; \
152+
elif [ $(echo "$PG_SERVER_VERSION == 17" | /usr/bin/bc) = "1" ]; then \
153+
cd /tmp && git clone --branch REL4_1_0 https://github.com/pgaudit/set_user.git \
154+
&& cd set_user && make USE_PGXS=1 && make USE_PGXS=1 install; \
155+
elif [ $(echo "$PG_SERVER_VERSION == 9.6" | /usr/bin/bc) = "1" ]; then \
156+
cd /tmp && git clone --branch REL4_0_1 https://github.com/pgaudit/set_user.git \
157+
&& cd set_user && make USE_PGXS=1 && make USE_PGXS=1 install; \
155158
fi \
156159
# logerrors extension
157160
&& if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \

extended-postgres/build-images-ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ build-extended-postgres-16-image-latest:
110110
PG_SERVER_VERSION: "16"
111111
TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_TAG}"
112112

113+
build-extended-postgres-17-image-latest:
114+
<<: *build_image_definition_dh
115+
<<: *only_tag_release
116+
variables:
117+
<<: *extended_image_vars_dh
118+
PG_SERVER_VERSION: "17rc1"
119+
TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_TAG}"
120+
113121
build-extended-postgres-9-6-image-feature:
114122
<<: *build_image_definition_gl
115123
<<: *only_feature
@@ -173,3 +181,11 @@ build-extended-postgres-16-image-feature:
173181
<<: *extended_image_vars_gl
174182
PG_SERVER_VERSION: "16"
175183
TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_REF_SLUG}"
184+
185+
build-extended-postgres-17-image-feature:
186+
<<: *build_image_definition_gl
187+
<<: *only_feature
188+
variables:
189+
<<: *extended_image_vars_gl
190+
PG_SERVER_VERSION: "17rc1"
191+
TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_REF_SLUG}"

0 commit comments

Comments
 (0)