8000 Merge branch '2024-08-08' into 'master' · postgres-ai/custom-images@de12470 · GitHub
[go: up one dir, main page]

Skip to content

Commit de12470

Browse files
committed
Merge branch '2024-08-08' into 'master'
Update Postgres to latest minors (16.4, 15.8, 14.13, 13.16, 12.20); install WAL-G from the binary file; PG16 is default See merge request postgres-ai/custom-images!65
2 parents 1582b58 + a046b16 commit de12470

File tree

1 file changed

+21
-37
lines changed

1 file changed

+21
-37
lines changed

extended-postgres/Dockerfile

Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,36 @@
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=15
6-
7-
# build-env
8-
FROM postgres:${PG_SERVER_VERSION}-bullseye as build-env
9-
10-
ARG TARGETPLATFORM
11-
12-
ARG GO_VERSION
13-
ENV GO_VERSION=${GO_VERSION:-1.22.5}
14-
15-
ARG WALG_VERSION
16-
ENV WALG_VERSION=${WALG_VERSION:-3.0.2}
17-
18-
RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
19-
# install dependencies
20-
&& apt-get update -o Acquire::CompressionTypes::Order::=gz \
21-
&& apt-get install --no-install-recommends -y apt-transport-https ca-certificates \
22-
wget curl sudo git make cmake gcc build-essential \
23-
libbrotli-dev liblzo2-dev libsodium-dev \
24-
# install Go
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 \
29-
# build WAL-G
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-
&& go mod tidy \
33-
&& make deps && GOBIN=/usr/local/bin make pg_install
34-
5+
ARG PG_SERVER_VERSION=16
356

367
# Build the extended image
378
FROM postgres:${PG_SERVER_VERSION}-bullseye
389
LABEL maintainer="postgres.ai"
3910

40-
COPY --from=build-env /usr/local/bin/wal-g /usr/local/bin/wal-g
41-
4211
ARG PG_SERVER_VERSION
43-
ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-15}
12+
ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-16}
4413

4514
ARG PG_UNIX_SOCKET_DIR
4615
ENV PG_UNIX_SOCKET_DIR=${PG_UNIX_SOCKET_DIR:-"/var/run/postgresql"}
4716

4817
ARG PG_SERVER_PORT
4918
ENV PG_SERVER_PORT=${PG_SERVER_PORT:-5432}
5019

20+
ARG WALG_VERSION
21+
ENV WALG_VERSION=${WALG_VERSION:-3.0.3}
22+
5123
ARG PG_TIMETABLE_VERSION
5224
ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-5.9.0}
25+
5326
ARG SET_USER_VERSION
54-
ENV SET_USER_VERSION=${SET_USER_VERSION:-REL4_0_1}
27+
ENV SET_USER_VERSION=${SET_USER_VERSION:-REL4_1_0}
28+
5529
ARG LOGERRORS_VERSION
56-
ENV LOGERRORS_VERSION=${LOGERRORS_VERSION:-2.1.2}
30+
ENV LOGERRORS_VERSION=${LOGERRORS_VERSION:-2.1.3}
31+
5732
ARG PGVECTOR_VERSION
58-
ENV PGVECTOR_VERSION=${PGVECTOR_VERSION:-0.7.2}
33+
ENV PGVECTOR_VERSION=${PGVECTOR_VERSION:-0.7.4}
34+
5935
# https://gitlab.com/postgres-ai/custom-images/-/merge_requests/56
6036
ARG PG_CRON_VERSION
6137
ENV PG_CRON_VERSION=${PG_CRON_VERSION:-1.4.2}
@@ -170,9 +146,12 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
170146
# pgextwlist extension
171147
&& apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pgextwlist \
172148
# set_user extension
173-
&& if [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \
149+
&& if [ $(echo "$PG_SERVER_VERSION >= 12" | /usr/bin/bc) = "1" ]; then \
174150
cd /tmp && git clone https://github.com/pgaudit/set_user.git \
175151
&& 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; \
176155
fi \
177156
# logerrors extension
178157
&& if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \
@@ -199,6 +178,11 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
199178
pgbackrest zstd openssh-client \
200179
&& mkdir -p -m 700 /var/lib/postgresql/.ssh \
201180
&& chown postgres:postgres /var/lib/postgresql/.ssh \
181+
# WAL-G
182+
&& wget https://github.com/wal-g/wal-g/releases/download/v"${WALG_VERSION}"/wal-g-pg-ubuntu-20.04-amd64.tar.gz \
183+
&& tar -zxvf wal-g-pg-ubuntu-20.04-amd64.tar.gz \
184+
&& mv wal-g-pg-ubuntu-20.04-amd64 /usr/local/bin/wal-g \
185+
&& wal-g --version \
202186
# remove all auxilary packages to reduce final image size
203187
&& cd / && rm -rf /tmp/* && apt-get purge -y --auto-remove \
204188
gcc make wget unzip curl libc6-dev apt-transport-https git \

0 commit comments

Comments
 (0)
0