Skip to content

Commit

Permalink
Upgrade postgres to v17.2 in compose
Browse files Browse the repository at this point in the history
  • Loading branch information
akheron committed Feb 13, 2025
1 parent 6f14b50 commit bedc924
Showing 1 changed file with 2 additions and 30 deletions.
32 changes: 2 additions & 30 deletions compose/db/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,12 @@
#
# SPDX-License-Identifier: LGPL-2.1-or-later

ARG BASE_IMAGE=library/postgres
ARG BASE_IMAGE_VERSION=16-alpine3.19

FROM ${BASE_IMAGE}:${BASE_IMAGE_VERSION} AS ext_builder
# Extension whitelisting to simulate the RDS behaviour
# Build https://github.com/dimitri/pgextwlist package from source, transfer it to target installation

WORKDIR /build/

RUN apk add --update alpine-sdk postgresql-dev

ARG PGEXTWLIST_VERSION="1.17"
RUN curl -sSfL https://github.com/dimitri/pgextwlist/archive/refs/tags/v${PGEXTWLIST_VERSION}.tar.gz \
-o pgextwlist.tar.gz \
&& echo "183eae8b80e61431f0950b29a2552dd20ceebc9cb63f8fe40e48c84d6e6c033b pgextwlist.tar.gz" | sha256sum -c - \
&& tar xvzf pgextwlist.tar.gz \
&& cd pgextwlist-${PGEXTWLIST_VERSION} \
&& make \
&& make install \
&& cp pgextwlist.so .. \
&& cd - \
&& rm pgextwlist.tar.gz pgextwlist-${PGEXTWLIST_VERSION} -rf

FROM ${BASE_IMAGE}:${BASE_IMAGE_VERSION}

COPY --from=ext_builder /build/pgextwlist.so pgextwlist.so

RUN mkdir "$(pg_config --pkglibdir)/plugins" \
&& install pgextwlist.so "$(pg_config --pkglibdir)/plugins/pgextwlist.so"
FROM library/postgres:17-alpine3.21

COPY postgresql.conf /var/lib/postgresql/

# Add the initialisation scripts
COPY entry/* /docker-entrypoint-initdb.d/

# Force the modified postgres configuration ito use
# Force the modified postgres configuration into use
CMD ["-c", "config_file=/var/lib/postgresql/postgresql.conf"]

0 comments on commit bedc924

Please sign in to comment.