Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e103363

Browse filesBrowse files
committed
(DLE CE images) Full support of Postgres 15; add pgvector; multiple parts upgraded
1 parent fdc9e7e commit e103363
Copy full SHA for e103363

File tree

Expand file treeCollapse file tree

1 file changed

+65
-83
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+65
-83
lines changed

‎extended-postgres/Dockerfile

Copy file name to clipboardExpand all lines: extended-postgres/Dockerfile
+65-83Lines changed: 65 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22
# If you are using "physical" mode, please check the glibc version in your production database system to avoid potential index corruption.
33
# You should have the same version of glibc as in your Docker image.
44

5-
ARG PG_SERVER_VERSION=14
5+
ARG PG_SERVER_VERSION=15
66

77
# build-env
88
FROM postgres:${PG_SERVER_VERSION}-bullseye as build-env
99

10-
ARG WALG_VERSION
11-
ENV WALG_VERSION=${WALG_VERSION:-2.0.0}
10+
ARG TARGETPLATFORM
1211

1312
ARG GO_VERSION
14-
ENV GO_VERSION=${GO_VERSION:-1.18.4}
13+
ENV GO_VERSION=${GO_VERSION:-1.20.3}
14+
15+
ARG WALG_VERSION
16+
ENV WALG_VERSION=${WALG_VERSION:-2.0.1}
1517

1618
RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
1719
# install dependencies
@@ -20,13 +22,15 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
2022
wget curl sudo git make cmake gcc build-essential \
2123
libbrotli-dev liblzo2-dev libsodium-dev \
2224
# install Go
23-
&& cd /tmp && wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz \
24-
&& rm -rf /usr/local/go && tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz \
25-
&& export PATH=$PATH:/usr/local/go/bin \
25+
&& cd /tmp && GO_ARCH=$(if [ -z "${TARGETPLATFORM}" ]; then echo "amd64"; else echo ${TARGETPLATFORM} | cut -d '/' -f2; fi) \
26+
&& export PATH=$PATH:/usr/local/go/bin && wget https://go.dev/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz \
27+
&& rm -rf /usr/local/go && tar -C /usr/local -xzf go${GO_VERSION}.linux-${GO_ARCH}.tar.gz \
28+
&& export PATH=$PATH:/usr/local/go/bin \
2629
# build WAL-G
27-
&& git clone --branch v${WALG_VERSION} --single-branch https://github.com/wal-g/wal-g.git \
28-
&& cd wal-g && export USE_LIBSODIUM=1 && export USE_LZO=1 \
29-
&& make deps && GOBIN=/usr/local/bin make pg_install
30+
&& cd /tmp && git clone --branch v${WALG_VERSION} --single-branch https://github.com/wal-g/wal-g.git \
31+
&& cd wal-g && export USE_LIBSODIUM=1 && export USE_LZO=1 \
32+
&& make deps && GOBIN=/usr/local/bin make pg_install
33+
3034

3135
# Build the extended image
3236
FROM postgres:${PG_SERVER_VERSION}-bullseye
@@ -35,10 +39,16 @@ LABEL maintainer="postgres.ai"
3539
COPY --from=build-env /usr/local/bin/wal-g /usr/local/bin/wal-g
3640

3741
ARG PG_SERVER_VERSION
38-
ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-14}
42+
ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-15}
3943

4044
ARG PG_TIMETABLE_VERSION
41-
ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-4.9.0}
45+
ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-5.3.0}
46+
ARG SET_USER_VERSION
47+
ENV SET_USER_VERSION=${SET_USER_VERSION:-REL4_0_1}
48+
ARG LOGERRORS_VERSION
49+
ENV LOGERRORS_VERSION=${LOGERRORS_VERSION:-2.1.2}
50+
ARG PGVECTOR_VERSION
51+
ENV PGVECTOR_VERSION=${PGVECTOR_VERSION:-0.4.1}
4252

4353
RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
4454
# remove the "beta" and "rc" suffix in the PG_SERVER_VERSION variable (if exists)
@@ -47,54 +57,35 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
4757
&& apt-get install --no-install-recommends -y wget make gcc unzip sudo git \
4858
curl libc6-dev apt-transport-https ca-certificates pgxnclient bc \
4959
build-essential libssl-dev krb5-multidev libkrb5-dev lsb-release apt-utils \
50-
&& apt-get install --no-install-recommends -y \
51-
postgresql-server-dev-${PG_SERVER_VERSION} \
60+
&& apt-get install --no-install-recommends -y postgresql-server-dev-${PG_SERVER_VERSION} \
5261
# plpython3 (procedural language implementation for Python 3.x)
53-
&& apt-get install --no-install-recommends -y \
54-
postgresql-plpython3-${PG_SERVER_VERSION} \
62+
&& apt-get install --no-install-recommends -y postgresql-plpython3-${PG_SERVER_VERSION} \
5563
# amcheck extension; not included in contrib for Postgres 9.6
5664
&& if [ "${PG_SERVER_VERSION}" = "9.6" ]; then \
57-
apt-get install --no-install-recommends -y \
58-
postgresql-9.6-amcheck; \
65+
apt-get install --no-install-recommends -y postgresql-9.6-amcheck; \
5966
fi \
6067
# pg_repack extension
61-
&& if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \
62-
apt-get install --no-install-recommends -y \
63-
postgresql-${PG_SERVER_VERSION}-repack; \
64-
fi \
68+
&& apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-repack \
6569
# hypopg extension
6670
&& apt-get install --no-install-recommends -y \
67-
postgresql-${PG_SERVER_VERSION}-hypopg \
68-
postgresql-${PG_SERVER_VERSION}-hypopg-dbgsym \
71+
postgresql-${PG_SERVER_VERSION}-hypopg \
72+
postgresql-${PG_SERVER_VERSION}-hypopg-dbgsym \
6973
# pgaudit extension
70-
&& apt-get install --no-install-recommends -y \
71-
postgresql-${PG_SERVER_VERSION}-pgaudit \
74+
&& apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pgaudit \
7275
# pg_hint_plan extension
73-
&& if [ $(echo "$PG_SERVER_VERSION < 14" | /usr/bin/bc) = "1" ]; then \
74-
export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\.//') \
75-
&& wget --quiet -O /tmp/pg_hint_plan.zip \
76-
https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \
77-
&& unzip /tmp/pg_hint_plan.zip -d /tmp \
78-
&& cd /tmp/pg_hint_plan-PG${PG_PLAN_HINT_VERSION} \
79-
&& make && make install; \
80-
# there is no branch "PG14", use the tag "REL14_1_4_0"
81-
elif [ "${PG_SERVER_VERSION}" = "14" ]; then \
82-
wget --quiet -O /tmp/pg_hint_plan.zip \
83-
https://github.com/ossc-db/pg_hint_plan/archive/REL14_1_4_0.zip \
84-
&& unzip /tmp/pg_hint_plan.zip -d /tmp \
85-
&& cd /tmp/pg_hint_plan-REL14_1_4_0 \
86-
&& make && make install; \
87-
fi \
76+
&& export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\.//') \
77+
&& wget --quiet -O /tmp/pg_hint_plan.zip \
78+
https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \
79+
&& unzip /tmp/pg_hint_plan.zip -d /tmp \
80+
&& cd /tmp/pg_hint_plan-PG${PG_PLAN_HINT_VERSION} \
81+
&& make && make install \
8882
# powa extension
89-
&& apt-get install --no-install-recommends -y \
90-
postgresql-${PG_SERVER_VERSION}-powa \
83+
&& apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-powa \
9184
# pg_auth_mon extension
92-
&& if [ $(echo "$PG_SERVER_VERSION < 14" | /usr/bin/bc) = "1" ]; then \
93-
git clone https://github.com/RafiaSabih/pg_auth_mon.git \
94-
&& cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \
95-
fi \
85+
&& cd /tmp && git clone https://github.com/RafiaSabih/pg_auth_mon.git \
86+
&& cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install \
9687
# timescaledb extension
97-
&& if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \
88+
&& if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ]; then \
9889
echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/timescaledb.list \
9990
&& wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \
10091
&& apt-get update \
@@ -109,68 +100,59 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
109100
elif [ "${PG_SERVER_VERSION}" = "14" ]; then CITUS_VERSION="11.1"; \
110101
elif [ "${PG_SERVER_VERSION}" = "15" ]; then CITUS_VERSION="11.1"; \
111102
fi \
112-
&& curl -s https://install.citusdata.com/community/deb.sh | bash \
113-
&& apt-get install --no-install-recommends -y \
114-
postgresql-"${PG_SERVER_VERSION}"-citus-"${CITUS_VERSION}"; \
103+
&& curl -s https://install.citusdata.com/community/deb.sh | bash \
104+
&& apt-get install --no-install-recommends -y postgresql-"${PG_SERVER_VERSION}"-citus-"${CITUS_VERSION}"; \
115105
fi \
116106
# hll extension
117-
&& apt-get install --no-install-recommends -y \
118-
postgresql-"${PG_SERVER_VERSION}"-hll \
107+
&& apt-get install --no-install-recommends -y postgresql-"${PG_SERVER_VERSION}"-hll \
119108
# topn extension
120109
&& if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \
121110
curl -s https://install.citusdata.com/community/deb.sh | bash \
122-
&& apt-get install --no-install-recommends -y \
123-
postgresql-"${PG_SERVER_VERSION}"-topn; \
111+
&& apt-get install --no-install-recommends -y postgresql-"${PG_SERVER_VERSION}"-topn; \
124112
fi \
125113
# pg_timetable extension
126114
&& wget https://github.com/cybertec-postgresql/pg_timetable/releases/download/v${PG_TIMETABLE_VERSION}/pg_timetable_${PG_TIMETABLE_VERSION}_Linux_x86_64.deb \
127115
&& dpkg -i pg_timetable_${PG_TIMETABLE_VERSION}_Linux_x86_64.deb \
128116
&& rm -rf pg_timetable_${PG_TIMETABLE_VERSION}_Linux_x86_64.deb \
129117
# pg_show_plans extension
130-
&& if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \
131-
git clone https://github.com/cybertec-postgresql/pg_show_plans.git \
118+
&& if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ]; then \
119+
cd /tmp && git clone https://github.com/cybertec-postgresql/pg_show_plans.git \
132120
&& cd pg_show_plans \
133-
&& export USE_PGXS=1 && make && make install && cd .. && rm -rf pg_show_plans; \
121+
&& export USE_PGXS=1 && make && make install; \
134122
fi \
135123
# pg_cron extension
136-
&& if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \
137-
apt-get install --no-install-recommends -y \
138-
postgresql-${PG_SERVER_VERSION}-cron; \
139-
fi \
124+
&& apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-cron \
140125
# postgresql_anonymizer extension
141126
&& pgxn install ddlx && pgxn install postgresql_anonymizer \
142127
# pg_stat_kcache extension
143-
&& apt-get install --no-install-recommends -y \
144-
postgresql-${PG_SERVER_VERSION}-pg-stat-kcache \
128+
&& apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-stat-kcache \
145129
# pg_wait_sampling extension
146-
&& apt-get install --no-install-recommends -y \
147-
postgresql-${PG_SERVER_VERSION}-pg-wait-sampling \
130+
&& apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-wait-sampling \
148131
# pg_qualstats extension
149-
&& apt-get install --no-install-recommends -y \
150-
postgresql-${PG_SERVER_VERSION}-pg-qualstats \
132+
&& apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-qualstats \
151133
# bg_mon extension
152134
&& apt-get install -y libevent-dev libbrotli-dev \
153135
&& git clone https://github.com/CyberDem0n/bg_mon.git && cd bg_mon \
154136
&& USE_PGXS=1 make && USE_PGXS=1 make install && cd .. \
155137
# pgextwlist extension
156-
&& apt-get install --no-install-recommends -y \
157-
postgresql-${PG_SERVER_VERSION}-pgextwlist \
138+
&& apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pgextwlist \
158139
# set_user extension
159140
&& git clone https://github.com/pgaudit/set_user.git \
160-
&& cd set_user && git checkout REL3_0_0 && make USE_PGXS=1 && make USE_PGXS=1 install \
141+
&& cd set_user && git checkout ${SET_USER_VERSION} && make USE_PGXS=1 && make USE_PGXS=1 install \
161142
# logerrors extension
162143
&& if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \
163-
# build logerrors v2.0
164-
if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \
165-
cd /tmp && wget https://github.com/munakoiso/logerrors/archive/v2.0.tar.gz \
166-
&& tar -xf v2.0.tar.gz && rm v2.0.tar.gz && cd logerrors-2.0 \
167-
&& USE_PGXS=1 make && USE_PGXS=1 make install; \
168-
# build logerrors from the master branch for PostgreSQL 15
169-
elif [ "${PG_SERVER_VERSION}" = "15" ]; then \
170-
cd /tmp && git clone https://github.com/munakoiso/logerrors.git \
171-
&& cd logerrors \
172-
&& USE_PGXS=1 make && USE_PGXS=1 make install; \
173-
fi \
144+
cd /tmp && wget -O logerrors.tar.gz https://github.com/munakoiso/logerrors/archive/v${LOGERRORS_VERSION}.tar.gz \
145+
&& tar -xf logerrors.tar.gz && rm logerrors.tar.gz && cd logerrors-${LOGERRORS_VERSION} \
146+
&& USE_PGXS=1 make && USE_PGXS=1 make install; \
147+
fi \
148+
# pgvector extension
149+
&& if [ $(echo "$PG_SERVER_VERSION > 10" | /usr/bin/bc) = "1" ]; then \
150+
cd /tmp && git clone --branch v${PGVECTOR_VERSION} https://github.com/pgvector/pgvector.git \
151+
&& cd pgvector && make OPTFLAGS="" install \
152+
&& mkdir /usr/share/doc/pgvector \
153+
&& cp LICENSE README.md /usr/share/doc/pgvector \
154+
# it seems, v0.4.1 has incomplete setup process – we need to copy .sql manually
155+
&& cp sql/vector.sql /usr/share/postgresql/${PG_SERVER_VERSION}/extension/vector--${PGVECTOR_VERSION}.sql; \
174156
fi \
175157
# pgBackRest
176158
&& apt-get install --no-install-recommends -y \
@@ -186,7 +168,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
186168
&& apt-get clean -y autoclean \
187169
&& rm -rf /var/lib/apt/lists/* \
188170
# remove standard pgdata
189-
&& rm -rf /var/lib/postgresql/${PG_SERVER_VERSION}/
171+
&& rm -rf /var/lib/postgresql/${PG_SERVER_VERSION}/
190172

191173
EXPOSE 5432
192174

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.